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 |
# File 'lib/qpush/server/perform.rb', line 7 def initialize @done = false end |
Instance Method Details
#shutdown ⇒ Object
Shutsdown our perform process.
22 23 24 |
# File 'lib/qpush/server/perform.rb', line 22 def shutdown @done = true end |
#start ⇒ Object
Starts our perform process. This will run until instructed to stop.
13 14 15 16 17 18 |
# File 'lib/qpush/server/perform.rb', line 13 def start until @done job = retrieve_job job.execute if job end end |