Class: QPush::Server::Queue
- Inherits:
-
Object
- Object
- QPush::Server::Queue
- Defined in:
- lib/qpush/server/queue.rb
Overview
The Queue worker takes any jobs that are queued into our Redis server, and moves them to the appropriate list within Redis. It will perform a ‘blocking pop’ on our queue list until one is added.
Instance Method Summary collapse
-
#initialize ⇒ Queue
constructor
A new instance of Queue.
-
#shutdown ⇒ Object
Shutsdown our queue process.
-
#start ⇒ Object
Starts our queue process.
Constructor Details
#initialize ⇒ Queue
Returns a new instance of Queue.
8 9 10 |
# File 'lib/qpush/server/queue.rb', line 8 def initialize @done = false end |
Instance Method Details
#shutdown ⇒ Object
Shutsdown our queue process.
23 24 25 |
# File 'lib/qpush/server/queue.rb', line 23 def shutdown @done = true end |
#start ⇒ Object
Starts our queue process. This will run until instructed to stop.
14 15 16 17 18 19 |
# File 'lib/qpush/server/queue.rb', line 14 def start until @done job = retrieve_job job.setup if job end end |