Module: CZTop::SendReceiveMethods

Included in:
Actor, Socket
Defined in:
lib/cztop/send_receive_methods.rb

Overview

These are methods that can be used on a Socket as well as an Actor, but actually just pass through to methods of Message (which take a polymorphic reference, in Ruby as well as in C).

Instance Method Summary collapse

Instance Method Details

#<<(message) ⇒ self

Sends a message.

Parameters:

  • message (Message, String, Array<parts>)

    the message to send

Returns:

  • (self)

Raises:

See Also:



18
19
20
21
# File 'lib/cztop/send_receive_methods.rb', line 18

def <<(message)
  Message.coerce(message).send_to(self)
  self
end

#receiveMessage

Receives a message.

Returns:

Raises:

See Also:



31
32
33
# File 'lib/cztop/send_receive_methods.rb', line 31

def receive
  Message.receive_from(self)
end