class Celluloid::CellProxy
Public Class Methods
_load(string)
click to toggle source
Create an actor proxy object which routes messages over DCell's overlay network and back to the original mailbox
# File lib/dcell/celluloid_ext.rb, line 30 def self._load(string) mailbox = ::Celluloid::Mailbox._load(string) case mailbox when ::DCell::MailboxProxy actor = ::DCell::Actor.new(mailbox) ::DCell::CellProxy.new actor.proxy, mailbox, actor.subject.class.to_s when ::Celluloid::Mailbox actor = find_actor(mailbox) ::Celluloid::CellProxy.new actor.proxy, mailbox, actor.behavior.subject.class.to_s else ::Kernel.raise "funny, I did not expect to see a #{mailbox.class} here" end end
find_actor(mailbox)
click to toggle source
# File lib/dcell/celluloid_ext.rb, line 45 def self.find_actor(mailbox) ::Thread.list.each do |t| if actor = t[:celluloid_actor] return actor if actor.mailbox == mailbox end end ::Kernel.raise "no actor found for mailbox: #{mailbox.inspect}" end
Public Instance Methods
__respond_to?(meth, check_private = false)
Marshal uses respond_to? to determine if this object supports _dump so unfortunately we have to monkeypatch in _dump support as the proxy itself normally jacks respond_to? and proxies to the actor
Alias for: respond_to?
_dump(level)
click to toggle source
Dump an actor proxy via its mailbox
# File lib/dcell/celluloid_ext.rb, line 24 def _dump(level) @mailbox._dump(level) end
respond_to?(meth, check_private = false)
click to toggle source
# File lib/dcell/celluloid_ext.rb, line 17 def respond_to?(meth, check_private = false) return false if meth == :marshal_dump return true if meth == :_dump __respond_to?(meth, check_private) end
Also aliased as: __respond_to?