class JobDispatch::Sockets::Enqueue

Public Class Methods

new(bind_address) click to toggle source
# File lib/job_dispatch/sockets/enqueue.rb, line 3
def initialize(bind_address)
  @socket = JobDispatch.context.socket(ZMQ::REQ)
  @socket.bind(bind_address)
end

Public Instance Methods

poll_item() click to toggle source
# File lib/job_dispatch/sockets/enqueue.rb, line 8
def poll_item
  @poll_item ||= ZMQ::Pollitem(@socket, ZMQ::POLLIN)
end
process() click to toggle source

Enqueue socket when it receives a message simply stores it in the database. It will also send a message to wake a connected dispatcher

# File lib/job_dispatch/sockets/enqueue.rb, line 14
def process

end