Class: Roby::Distributed::CallSpec

Inherits:
Struct
  • Object
show all
Defined in:
lib/roby/distributed/communication.rb,
lib/roby/distributed/communication.rb

Overview

The specification of a call in Peer#send_queue and Peer#completion_queue. Note that only the #is_callback, #method and #formatted_args are sent to the remote PeerServer#demux method

  • is_callback is a boolean flag indicating if this call has been queued while the PeerServer object was processing a remote request

  • method is the method name to call on the remote PeerServer object

  • formatted_args is the arguments formatted by Distributed.format. Arguments are formatted right away, since we want the marshalled arguments to reflect objects state at the time of the call, not at the time they are sent

  • original_args is the arguments not yet formatted. They are kept here to protect involved object from Ruby’s GC until the call is completed.

  • on_completion is a proc object which will be called when the method has successfully been processed by the remote object, with the returned value as argument$

  • trace is the location (as returned by Kernel#caller) from which the call has been queued. It is mainly used for debugging purposes

  • if thread is not nil, it is the thread which is waiting for the call to complete. If the call is aborted, the error will be raised in the waiting thread

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#formatted_argsObject

Returns the value of attribute formatted_args

Returns:

  • (Object)

    the current value of formatted_args



421
422
423
# File 'lib/roby/distributed/communication.rb', line 421

def formatted_args
  @formatted_args
end

#is_callbackObject Also known as: callback?

Returns the value of attribute is_callback

Returns:

  • (Object)

    the current value of is_callback



421
422
423
# File 'lib/roby/distributed/communication.rb', line 421

def is_callback
  @is_callback
end

#message_idObject

Returns the value of attribute message_id

Returns:

  • (Object)

    the current value of message_id



421
422
423
# File 'lib/roby/distributed/communication.rb', line 421

def message_id
  @message_id
end

#methodObject

Returns the value of attribute method

Returns:

  • (Object)

    the current value of method



421
422
423
# File 'lib/roby/distributed/communication.rb', line 421

def method
  @method
end

#on_completionObject

Returns the value of attribute on_completion

Returns:

  • (Object)

    the current value of on_completion



421
422
423
# File 'lib/roby/distributed/communication.rb', line 421

def on_completion
  @on_completion
end

#original_argsObject

Returns the value of attribute original_args

Returns:

  • (Object)

    the current value of original_args



421
422
423
# File 'lib/roby/distributed/communication.rb', line 421

def original_args
  @original_args
end

#traceObject

Returns the value of attribute trace

Returns:

  • (Object)

    the current value of trace



421
422
423
# File 'lib/roby/distributed/communication.rb', line 421

def trace
  @trace
end

#waiting_threadObject

Returns the value of attribute waiting_thread

Returns:

  • (Object)

    the current value of waiting_thread



421
422
423
# File 'lib/roby/distributed/communication.rb', line 421

def waiting_thread
  @waiting_thread
end

Instance Method Details

#to_sObject



452
453
454
455
456
457
458
459
# File 'lib/roby/distributed/communication.rb', line 452

def to_s
		args = formatted_args.map do |arg|
 if arg.kind_of?(DRbObject) then arg.inspect
 else arg.to_s
 end
		end
		"#{method}(#{args.join(", ")})"
end