Sha256: ea8d3e1a691e66ea324341460008f4c6be9b7944ef335b0aee587bd1eabffe0e

Contents?: true

Size: 605 Bytes

Versions: 9

Compression:

Stored size: 605 Bytes

Contents

require 'spec_helper'

describe Celluloid::ThreadHandle do
  let(:actor_system) do
    Celluloid::ActorSystem.new
  end

  it "knows thread liveliness" do
    queue = Queue.new
    handle = Celluloid::ThreadHandle.new(actor_system) { queue.pop }
    handle.should be_alive

    queue << :die

    sleep 0.01 # hax
    handle.should_not be_alive
  end

  it "joins to thread handles" do
    Celluloid::ThreadHandle.new(actor_system) { sleep 0.01 }.join
  end

  it "supports passing a role" do
    Celluloid::ThreadHandle.new(actor_system, :useful) { Thread.current.role.should == :useful }.join
  end
end

Version data entries

9 entries across 7 versions & 4 rubygems

Version Path
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/celluloid-0.16.0/spec/celluloid/thread_handle_spec.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/celluloid-0.16.0/spec/celluloid/thread_handle_spec.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/celluloid-0.16.0/spec/celluloid/thread_handle_spec.rb
scoot-0.0.4 .bundle/gems/ruby/2.2.0/gems/celluloid-0.16.0/spec/celluloid/thread_handle_spec.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/celluloid-0.16.0/spec/celluloid/thread_handle_spec.rb
celluloid-0.16.0 spec/celluloid/thread_handle_spec.rb
celluloid-0.16.0.pre3 spec/celluloid/thread_handle_spec.rb
celluloid-0.16.0.pre2 spec/celluloid/thread_handle_spec.rb
celluloid-0.16.0.pre spec/celluloid/thread_handle_spec.rb