Class: Mutant::Actor::Sender

Inherits:
Object
  • Object
show all
Includes:
Adamantium::Flat
Defined in:
lib/mutant/actor/sender.rb

Overview

Sender for messages to acting thread

Instance Method Summary collapse

Instance Method Details

#call(message) ⇒ self

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 a message to actor

Parameters:

  • message (Object)

Returns:

  • (self)

16
17
18
19
20
21
22
23
# File 'lib/mutant/actor/sender.rb', line 16

def call(message)
  mutex.synchronize do
    messages << message
    condition_variable.signal
  end

  self
end