Class: EMRPC::EventedWrapper
- Includes:
- Pid
- Defined in:
- lib/emrpc/evented_api/evented_wrapper.rb
Constant Summary
Constants included from ProtocolMapper
Instance Attribute Summary collapse
-
#backend ⇒ Object
Returns the value of attribute backend.
Attributes included from Pid
#_bind_address, #_em_server_signature, #_protocol, #connections, #killed, #options, #uuid
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ EventedWrapper
constructor
A new instance of EventedWrapper.
- #pid_class_name ⇒ Object
- #send(from, msg, *args) ⇒ Object
Methods included from Pid
#==, #_send_dirty, #_uid, #bind, #connect, #connection_established, #connection_unbind, #connection_uuids, #disconnect, #encode_b381b571_1ab2_5889_8221_855dbbc76242, #find_pid, #inspect, #kill, #killed?, #marshal_dump, #marshal_load, new, #spawn, #tcp_spawn, #thread_spawn
Methods included from DebugPidCallbacks
#_debug, #connected, #connection_failed, #disconnected, #handshake_failed, #on_raise, #on_return
Methods included from ProtocolMapper
#make_client_connection, #make_server_connection, register_protocol
Methods included from DefaultCallbacks
#connected, #connection_failed, #disconnected, #handshake_failed, #on_raise, #on_return
Constructor Details
#initialize(options = {}) ⇒ EventedWrapper
Returns a new instance of EventedWrapper.
7 8 9 10 |
# File 'lib/emrpc/evented_api/evented_wrapper.rb', line 7 def initialize( = {}) super @backend = [:backend] or raise ":backend option is missing!" end |
Instance Attribute Details
#backend ⇒ Object
Returns the value of attribute backend.
5 6 7 |
# File 'lib/emrpc/evented_api/evented_wrapper.rb', line 5 def backend @backend end |
Instance Method Details
#pid_class_name ⇒ Object
23 24 25 |
# File 'lib/emrpc/evented_api/evented_wrapper.rb', line 23 def pid_class_name "EventedWrapper" end |
#send(from, msg, *args) ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/emrpc/evented_api/evented_wrapper.rb', line 12 def send(from, msg, *args) #p [self, :send, {:from => from, :msg => msg, :args => args}] begin r = @backend.send(msg, *args) #p ["EventedWrapper returns", {:from => from, :send => [:on_return, self, r]}] from.send(:on_return, self, r) rescue => e from.send(:on_raise, self, e) end end |