Sha256: 5228cfe749584c57c44c3597eaad1a362a82b87a07e4a538a9d46fe5bafb16f9

Contents?: true

Size: 458 Bytes

Versions: 2

Compression:

Stored size: 458 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
      raise "Cannot use blocks with async yet"
    end
    @mailbox << ::Celluloid::Call::Async.new(meth, args, block)
    self
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
celluloid-0.18.0 lib/celluloid/proxy/async.rb
celluloid-0.18.0.pre2 lib/celluloid/proxy/async.rb