Class: EMRPC::LocalConnection
- Includes:
- ConnectionMixin
- Defined in:
- lib/emrpc/evented_api/local_connection.rb
Defined Under Namespace
Classes: Channel
Constant Summary collapse
- LOCALNODE_ADDRESS =
'emrpc://localnode/'.parsed_uri.freeze
Instance Attribute Summary collapse
-
#channel ⇒ Object
Returns the value of attribute channel.
Attributes included from ConnectionMixin
#connected_callback, #disconnected_callback, #local_pid, #remote_pid
Instance Method Summary collapse
- #address ⇒ Object
- #close_connection ⇒ Object (also: #close_connection_after_writing)
-
#initialize(local_pid, remote_pid, channel = nil) ⇒ LocalConnection
constructor
A new instance of LocalConnection.
- #unbind ⇒ Object
Constructor Details
#initialize(local_pid, remote_pid, channel = nil) ⇒ LocalConnection
Returns a new instance of LocalConnection.
23 24 25 26 27 |
# File 'lib/emrpc/evented_api/local_connection.rb', line 23 def initialize(local_pid, remote_pid, channel = nil) @channel = channel || Channel.new(local_pid, remote_pid, self) @local_pid = local_pid @remote_pid = local_pid.connection_established(remote_pid, self) end |
Instance Attribute Details
#channel ⇒ Object
Returns the value of attribute channel.
21 22 23 |
# File 'lib/emrpc/evented_api/local_connection.rb', line 21 def channel @channel end |
Instance Method Details
#address ⇒ Object
43 44 45 |
# File 'lib/emrpc/evented_api/local_connection.rb', line 43 def address LOCALNODE_ADDRESS end |
#close_connection ⇒ Object Also known as: close_connection_after_writing
37 38 39 |
# File 'lib/emrpc/evented_api/local_connection.rb', line 37 def close_connection @channel.unbind end |
#unbind ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/emrpc/evented_api/local_connection.rb', line 29 def unbind lpid = @local_pid rpid = @remote_pid @local_pid = nil @remote_pid = nil lpid.connection_unbind(rpid, self) end |