Parent

Class/Module Index [+]

Quicksearch

Celluloid::TaskFiber

Tasks with a Fiber backend

Public Instance Methods

create() click to toggle source
# File lib/celluloid/tasks/task_fiber.rb, line 7
def create
  @fiber = Fiber.new do
    # FIXME: cannot use the writer as specs run inside normal Threads
    Thread.current[:celluloid_role] = :actor
    yield
  end
end
deliver(value) click to toggle source

Resume a suspended task, giving it a value to return if needed

# File lib/celluloid/tasks/task_fiber.rb, line 20
def deliver(value)
  @fiber.resume value
rescue SystemStackError => ex
  raise FiberStackError, "#{ex} (please see https://github.com/celluloid/celluloid/wiki/Fiber-stack-errors)"
rescue FiberError => ex
  raise DeadTaskError, "cannot resume a dead task (#{ex})"
end
signal() click to toggle source
# File lib/celluloid/tasks/task_fiber.rb, line 15
def signal
  Fiber.yield
end
terminate() click to toggle source

Terminate this task

# File lib/celluloid/tasks/task_fiber.rb, line 29
def terminate
  super
rescue FiberError
  # If we're getting this the task should already be dead
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.