Sha256: 70e84375f30e411a67e295e5b29bc3737a7305ecc01440705ba87754fc58ed58

Contents?: true

Size: 490 Bytes

Versions: 13

Compression:

Stored size: 490 Bytes

Contents

module Celluloid
  # A proxy which creates future calls to an actor
  class FutureProxy < AbstractProxy
    attr_reader :mailbox

    def initialize(actor)
      @mailbox, @klass = actor.mailbox, actor.subject.class.to_s
    end

    def inspect
      "#<Celluloid::FutureProxy(#{@klass})>"
    end

    # method_missing black magic to call bang predicate methods asynchronously
    def method_missing(meth, *args, &block)
      Actor.future @mailbox, meth, *args, &block
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
celluloid-0.13.0 lib/celluloid/proxies/future_proxy.rb
celluloid-0.13.0.pre2 lib/celluloid/proxies/future_proxy.rb
celluloid-0.13.0.pre lib/celluloid/proxies/future_proxy.rb
celluloid-0.12.4 lib/celluloid/proxies/future_proxy.rb
celluloid-0.12.4.pre2 lib/celluloid/proxies/future_proxy.rb
celluloid-0.12.4.pre lib/celluloid/proxies/future_proxy.rb
celluloid-0.12.3 lib/celluloid/proxies/future_proxy.rb
celluloid-0.12.2 lib/celluloid/proxies/future_proxy.rb
celluloid-0.12.1 lib/celluloid/proxies/future_proxy.rb
celluloid-0.12.1.pre2 lib/celluloid/proxies/future_proxy.rb
celluloid-0.12.1.pre lib/celluloid/proxies/future_proxy.rb
celluloid-0.12.0 lib/celluloid/proxies/future_proxy.rb
celluloid-0.12.0.pre3 lib/celluloid/proxies/future_proxy.rb