Class: Procrastinate::ProcessManager::ObjectEndpoint

Inherits:
Struct
  • Object
show all
Defined in:
lib/procrastinate/process_manager/object_endpoint.rb

Overview

A class that acts as a filter between ProcessManager and the endpoint it uses to communicate with its children. This converts Ruby objects into Strings and also sends process id.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#endpointObject

Returns the value of attribute endpoint

Returns:

  • (Object)

    the current value of endpoint



5
6
7
# File 'lib/procrastinate/process_manager/object_endpoint.rb', line 5

def endpoint
  @endpoint
end

#pidObject

Returns the value of attribute pid

Returns:

  • (Object)

    the current value of pid



5
6
7
# File 'lib/procrastinate/process_manager/object_endpoint.rb', line 5

def pid
  @pid
end

Instance Method Details

#send(obj) ⇒ Object



6
7
8
9
# File 'lib/procrastinate/process_manager/object_endpoint.rb', line 6

def send(obj)
  msg = Marshal.dump([pid, obj])
  endpoint.send(msg)
end