lib/postman.rb
# The control loop. Checks the state of the process every three seconds
# stopping: cancels the consumer, sets the processes to stopped and breaks the loop
# stopped: (alive? returns false) terminates the loop.
# anything else: waits three seconds and tries again
The control loop. Checks the state of the process every three seconds
stopping: cancels the consumer, sets the processes to stopped and breaks the loop
stopped: (alive. returns false) terminates the loop.
anything else: waits three seconds and tries again
The control loop . Checks the state of the process every three seconds stopping : cancels the consumer sets the processes to stopped and breaks the loop stopped : ( alive . returns false ) terminates the loop . anything else : waits three seconds and tries again
def control_loop
    if stopping?
      unsubscribe!
      stopped!
    else
      attempt_recovery if paused?
      sleep(3)
    end
  end
def control_loop if stopping? unsubscribe! stopped! else attempt_recovery if paused? sleep ( 3 ) end end
The control loop.
The control loop .