Parent

Class/Module Index [+]

Quicksearch

Celluloid::SyncProxy

A proxy which sends synchronous calls to an actor

Attributes

mailbox[R]

Public Class Methods

new(mailbox, klass) click to toggle source
# File lib/celluloid/proxies/sync_proxy.rb, line 6
def initialize(mailbox, klass)
  @mailbox, @klass = mailbox, klass
end

Public Instance Methods

inspect() click to toggle source
# File lib/celluloid/proxies/sync_proxy.rb, line 10
def inspect
  "#<Celluloid::SyncProxy(#{@klass})>"
end
method_missing(meth, *args, &block) click to toggle source
# File lib/celluloid/proxies/sync_proxy.rb, line 14
def method_missing(meth, *args, &block)
  if @mailbox == ::Thread.current[:celluloid_mailbox]
    args.unshift meth
    meth = :__send__
  end

  call = SyncCall.new(::Celluloid.mailbox, meth, args, block)

  begin
    @mailbox << call
  rescue MailboxError
    raise DeadActorError, "attempted to call a dead actor"
  end

  call.value
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.