Module: Actor::Module::Start

Defined in:
lib/actor/module/start.rb

Instance Method Summary collapse

Instance Method Details

#start(*arguments, include: nil, **keyword_arguments, &block) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/actor/module/start.rb', line 4

def start(*arguments, include: nil, **keyword_arguments, &block)
  actor, thread = Actor::Start.(self, *arguments, **keyword_arguments, &block)

  address = actor.address

  if include
    return_values = [address]

    Array(include).each do |label|
      argument = { :thread => thread, :actor => actor }.fetch(label)

      return_values << argument
    end

    return return_values
  else
    return address
  end
end