Class: Mutant::Actor::Binding Private

Inherits:
Object
  • Object
show all
Defined in:
lib/mutant/actor.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Binding to other actors sender for simple RPC

Instance Method Summary collapse

Instance Method Details

#call(type) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Send message and wait for reply

Parameters:

  • type (Symbol)

Returns:

  • (Object)


48
49
50
51
52
53
# File 'lib/mutant/actor.rb', line 48

def call(type)
  other.call(Message.new(type, mailbox.sender))
  message = mailbox.receiver.call
  fail ProtocolError, "Expected #{type} but got #{message.type}" unless type.equal?(message.type)
  message.payload
end