Class: EMRPC::Client
Defined Under Namespace
Classes: BlockingPid
Instance Attribute Summary collapse
-
#address ⇒ Object
Returns the value of attribute address.
Instance Method Summary collapse
-
#initialize(address, options = {}) ⇒ Client
constructor
Single argument can be one of the following: * Address of pid to connect to (e.g. “emrpc://localhost:4000/”) * Pid to connect to.
- #kill_pid ⇒ Object
- #method_missing(meth, *args, &blk) ⇒ Object
Constructor Details
#initialize(address, options = {}) ⇒ Client
Single argument can be one of the following:
-
Address of pid to connect to (e.g. “emrpc://localhost:4000/”)
-
Pid to connect to. Use this instead of address to pass some pid for in-process communication.
You can also pass optional params for EMRPC::ReconnectingPid.
10 11 12 13 |
# File 'lib/emrpc/client.rb', line 10 def initialize(address, = {}) @address = address @pid = BlockingPid.new(@address, ) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, *args, &blk) ⇒ Object
15 16 17 |
# File 'lib/emrpc/client.rb', line 15 def method_missing(meth, *args, &blk) @pid.blocking_send(meth, *args) end |
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
3 4 5 |
# File 'lib/emrpc/client.rb', line 3 def address @address end |
Instance Method Details
#kill_pid ⇒ Object
19 20 21 |
# File 'lib/emrpc/client.rb', line 19 def kill_pid @pid.kill end |