Class: Mutant::Actor::Env Private

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

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

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



25
26
27
# File 'lib/mutant/actor/env.rb', line 25

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



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