class Mutest::Actor::Binding

Binding to other actors sender for simple RPC

Public Instance Methods

call(type) click to toggle source

Send message and wait for reply

@param [Symbol] type

@return [Object]

# File lib/mutest/actor.rb, line 44
def call(type)
  other.call(Message.new(type, mailbox.sender))
  message = mailbox.receiver.call
  raise ProtocolError, "Expected #{type} but got #{message.type}" unless type.equal?(message.type)

  message.payload
end