Class: Mutant::Actor::Env

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

Overview

Actor root environment

Instance Method Summary collapse

Instance Method Details

#new_mailboxMailbox

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.

Return new unbound mailbox

Returns:


29
30
31
# File 'lib/mutant/actor/env.rb', line 29

def new_mailbox
  Mailbox.new
end

#spawnActor::Sender

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.

Spawn a new actor executing block

Returns:


13
14
15
16
17
18
19
20
21
# File 'lib/mutant/actor/env.rb', line 13

def spawn
  mailbox = new_mailbox

  thread_root.new do
    yield mailbox
  end

  mailbox.sender
end