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.

New unbound mailbox

Returns:



27
28
29
# File 'lib/mutant/actor/env.rb', line 27

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:



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

def spawn
  mailbox = new_mailbox

  thread_root.new do
    yield mailbox
  end

  mailbox.sender
end