Class: OMQ::Transport::IPC::Dialer
- Inherits:
-
Object
- Object
- OMQ::Transport::IPC::Dialer
- Defined in:
- lib/omq/transport/ipc.rb
Overview
An IPC dialer — stateful factory for outgoing connections.
Instance Attribute Summary collapse
-
#endpoint ⇒ String
readonly
The endpoint this dialer connects to.
Instance Method Summary collapse
-
#connect ⇒ void
Establishes a Unix socket connection to the endpoint.
-
#initialize(endpoint, engine) ⇒ Dialer
constructor
A new instance of Dialer.
Constructor Details
#initialize(endpoint, engine) ⇒ Dialer
Returns a new instance of Dialer.
111 112 113 114 |
# File 'lib/omq/transport/ipc.rb', line 111 def initialize(endpoint, engine) @endpoint = endpoint @engine = engine end |
Instance Attribute Details
#endpoint ⇒ String (readonly)
Returns the endpoint this dialer connects to.
105 106 107 |
# File 'lib/omq/transport/ipc.rb', line 105 def endpoint @endpoint end |
Instance Method Details
#connect ⇒ void
This method returns an undefined value.
Establishes a Unix socket connection to the endpoint.
121 122 123 124 125 126 127 |
# File 'lib/omq/transport/ipc.rb', line 121 def connect path = IPC.parse_path(@endpoint) sock_path = IPC.to_socket_path(path) sock = UNIXSocket.new(sock_path) IPC.apply_buffer_sizes(sock, @engine.) @engine.handle_connected(IO::Stream::Buffered.wrap(sock), endpoint: @endpoint) end |