Sha256: 41ac45fc43c2ce2fa654c25890d0634443e7a4aa66a3c5b612ebe382ddf794dc

Contents?: true

Size: 457 Bytes

Versions: 3

Compression:

Stored size: 457 Bytes

Contents

# A proxy which sends asynchronous calls to an actor
class Celluloid::Proxy::Async < Celluloid::Proxy::AbstractCall
  def method_missing(meth, *args, &block)
    if @mailbox == ::Thread.current[:celluloid_mailbox]
      args.unshift meth
      meth = :__send__
    end
    if block_given?
      # FIXME: nicer exception
      fail "Cannot use blocks with async yet"
    end
    @mailbox << ::Celluloid::Call::Async.new(meth, args, block)
    self
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
celluloid-0.17.4 lib/celluloid/proxy/async.rb
celluloid-0.18.0.pre lib/celluloid/proxy/async.rb
celluloid-0.17.3 lib/celluloid/proxy/async.rb