Class: Delayed::WorkQueue::ParentProcess
- Inherits:
-
Object
- Object
- Delayed::WorkQueue::ParentProcess
- Defined in:
- lib/delayed/work_queue/parent_process.rb,
lib/delayed/work_queue/parent_process/client.rb,
lib/delayed/work_queue/parent_process/server.rb
Overview
want to be a lot more robust about partial reads/writes and timeouts.
Defined Under Namespace
Classes: Client, ProtocolError, Server
Instance Attribute Summary collapse
-
#server_address ⇒ Object
readonly
Returns the value of attribute server_address.
Instance Method Summary collapse
- #client ⇒ Object
-
#initialize(config = Settings.parent_process) ⇒ ParentProcess
constructor
A new instance of ParentProcess.
- #server(parent_pid: nil) ⇒ Object
Constructor Details
#initialize(config = Settings.parent_process) ⇒ ParentProcess
Returns a new instance of ParentProcess.
37 38 39 40 |
# File 'lib/delayed/work_queue/parent_process.rb', line 37 def initialize(config = Settings.parent_process) @config = config @server_address = generate_socket_path(config['server_address']) end |
Instance Attribute Details
#server_address ⇒ Object (readonly)
Returns the value of attribute server_address.
32 33 34 |
# File 'lib/delayed/work_queue/parent_process.rb', line 32 def server_address @server_address end |
Instance Method Details
#client ⇒ Object
49 50 51 |
# File 'lib/delayed/work_queue/parent_process.rb', line 49 def client Client.new(Addrinfo.unix(@server_address), config: @config) end |
#server(parent_pid: nil) ⇒ Object
42 43 44 45 46 47 |
# File 'lib/delayed/work_queue/parent_process.rb', line 42 def server(parent_pid: nil) # The unix_server_socket method takes care of cleaning up any existing # socket for us if the work queue process dies and is restarted. listen_socket = Socket.unix_server_socket(@server_address) Server.new(listen_socket, parent_pid: parent_pid, config: @config) end |