Sha256: a03bf67fc2f6443343e1e216ae21fe9905223f7c92e72857132d7d441b73d3d5
Contents?: true
Size: 551 Bytes
Versions: 4
Compression:
Stored size: 551 Bytes
Contents
require 'celluloid/fiber' # Monkeypatch Thread to allow lazy access to its Celluloid::Mailbox class Thread attr_accessor :uuid_counter, :uuid_limit # Retrieve the mailbox for the current thread or lazily initialize it def self.mailbox current[:celluloid_mailbox] ||= Celluloid::Mailbox.new end # Receive a message either as an actor or through the local mailbox def self.receive(timeout = nil, &block) if Celluloid.actor? Celluloid.receive(timeout, &block) else mailbox.receive(timeout, &block) end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
celluloid-0.13.0 | lib/celluloid/core_ext.rb |
celluloid-0.13.0.pre2 | lib/celluloid/core_ext.rb |
celluloid-0.13.0.pre | lib/celluloid/core_ext.rb |
celluloid-0.12.4.pre | lib/celluloid/core_ext.rb |