Sha256: b87423d3064a2406ab252d7cd8462ea9af53dac602f79ebbd37ea29c6b119973

Contents?: true

Size: 748 Bytes

Versions: 5

Compression:

Stored size: 748 Bytes

Contents

module Pione
  module Agent
    class TupleSpaceServerClientLifeChecker < BasicAgent
      include TupleSpaceServerInterface

      define_state :checking_bye
      define_state :cleaning_agent
      define_state :sleeping

      define_state_transition :initialized => :checking_bye
      define_state_transition :checking_bye => :cleaning_agent
      define_state_transition :cleaning_agent => :checking_bye

      def initialize(tuple_space_server)
        super()
        set_tuple_space_server(tuple_space_server)
      end

      def transit_to_checking_bye
        return take(Tuple[:bye].any)
      end

      def transit_to_cleaning_agent(bye)
        take(Tuple[:agent].new(uuid: bye.uuid))
        return nil
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
pione-0.1.4 lib/pione/agent/tuple-space-server-client-life-checker.rb
pione-0.1.3 lib/pione/agent/tuple-space-server-client-life-checker.rb
pione-0.1.2 lib/pione/agent/tuple-space-server-client-life-checker.rb
pione-0.1.1 lib/pione/agent/tuple-space-server-client-life-checker.rb
pione-0.1.0 lib/pione/agent/tuple-space-server-client-life-checker.rb