class Pione::Agent::TupleSpaceProvider

TupleSpaceProvider is an agent that provides a URI of tuple space as notification messages.

Public Class Methods

new(uri, targets=Global.notification_targets) click to toggle source

@param provider [URI]

URI of the tuple space

@param targets [Array<URI>]

target URIs
Calls superclass method Pione::Agent::BasicAgent::new
# File lib/pione/agent/tuple-space-provider.rb, line 16
def initialize(uri, targets=Global.notification_targets)
  super()
  @targets = targets
  @notification = Notification::Message.new(
    "TUPLE_SPACE_PROVIDER", "TUPLE_SPACE", {"front" => uri}
  )
end

Public Instance Methods

transit_to_send_message() click to toggle source

transitions

# File lib/pione/agent/tuple-space-provider.rb, line 39
def transit_to_send_message
  Notification::Transmitter.transmit(@notification, @targets)
end
transit_to_sleep() click to toggle source
# File lib/pione/agent/tuple-space-provider.rb, line 43
def transit_to_sleep
  sleep 5
end