Class: Celluloid::BlockCall

Inherits:
Object
  • Object
show all
Defined in:
lib/celluloid/calls.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(block_proxy, sender, arguments, task = Thread.current[:celluloid_task]) ⇒ BlockCall

Returns a new instance of BlockCall.


147
148
149
150
151
152
# File 'lib/celluloid/calls.rb', line 147

def initialize(block_proxy, sender, arguments, task = Thread.current[:celluloid_task])
  @block_proxy = block_proxy
  @sender = sender
  @arguments = arguments
  @task = task
end

Instance Attribute Details

#taskObject (readonly)

Returns the value of attribute task


153
154
155
# File 'lib/celluloid/calls.rb', line 153

def task
  @task
end

Instance Method Details

#callObject


155
156
157
# File 'lib/celluloid/calls.rb', line 155

def call
  @block_proxy.call
end

#dispatchObject


159
160
161
162
# File 'lib/celluloid/calls.rb', line 159

def dispatch
  response = @block_proxy.block.call(*@arguments)
  @sender << BlockResponse.new(self, response)
end