class Pione::Agent::TupleSpaceClient

Public Class Methods

new(tuple_space) click to toggle source

Initialize agent’s state.

Calls superclass method Pione::Agent::BasicAgent::new
# File lib/pione/agent/tuple-space-client.rb, line 75
def initialize(tuple_space)
  super()
  set_tuple_space(tuple_space)
end

Public Instance Methods

bye() click to toggle source

Redefine bye method with logging.

# File lib/pione/agent/tuple-space-client.rb, line 108
def bye
  record = Log::AgentConnectionProcessRecord.new.tap do |record|
    record.agent_type = agent_type
    record.agent_uuid = uuid
    record.message = "bye"
  end
  with_process_log(record) {super}
end
call_transition_method(*args) click to toggle source

Override call transition method with logging.

# File lib/pione/agent/tuple-space-client.rb, line 118
def call_transition_method(*args)
  unless [:logger, :job_terminator, :messenger].include?(agent_type)
    record = Log::AgentActivityProcessRecord.new.tap do |rec|
      rec.agent_type = agent_type
      rec.agent_uuid = uuid
      rec.state = args.first
    end
    with_process_log(record) {super}
  else
    super
  end
end
hello() click to toggle source

Redefine hello method with logging.

# File lib/pione/agent/tuple-space-client.rb, line 98
def hello
  record = Log::AgentConnectionProcessRecord.new.tap do |record|
    record.agent_type = agent_type
    record.agent_uuid = uuid
    record.message = "hello"
  end
  with_process_log(record) {super}
end
transit_to_init() click to toggle source

transitions

# File lib/pione/agent/tuple-space-client.rb, line 84
def transit_to_init
  hello
end
transit_to_terminate() click to toggle source
# File lib/pione/agent/tuple-space-client.rb, line 88
def transit_to_terminate
  Util.ignore_exception { bye }
  cancel_current_tuple_entry
end