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