Tasks with a Fiber backend
# File lib/celluloid/tasks/task_fiber.rb, line 39 def backtrace ["#{self.class} backtrace unavailable. Please try `Celluloid.task_class = Celluloid::TaskThread` if you need backtraces here."] end
# File lib/celluloid/tasks/task_fiber.rb, line 7 def create queue = Thread.current[:celluloid_queue] actor_system = Thread.current[:celluloid_actor_system] @fiber = Fiber.new do # FIXME: cannot use the writer as specs run inside normal Threads Thread.current[:celluloid_role] = :actor Thread.current[:celluloid_queue] = queue Thread.current[:celluloid_actor_system] = actor_system yield end end
Resume a suspended task, giving it a value to return if needed
# File lib/celluloid/tasks/task_fiber.rb, line 24 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
Generated with the Darkfish Rdoc Generator 2.