Sha256: 8316c23b3400984ffae6de25be90ee519bd371b52c7a01d3f17c07aac89ef6d5

Contents?: true

Size: 514 Bytes

Versions: 2

Compression:

Stored size: 514 Bytes

Contents

def create_async_blocking_actor(task_klass)
  actor_klass = Class.new(StackBlocker) do
    task_class task_klass
  end

  actor = actor_system.within do
    actor_klass.new(threads)
  end

  actor.async.blocking
end

def create_thread_with_role(threads, role)
  resume = Queue.new
  thread = actor_system.get_thread do
    resume.pop # to avoid race for 'thread' variable
    thread.role = role
    threads << thread
    StackWaiter.forever
  end
  resume << nil # to avoid race for 'thread' variable
  thread
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
celluloid-0.18.0 spec/support/examples/stack_methods.rb
celluloid-0.18.0.pre2 spec/support/examples/stack_methods.rb