Class: HardWorker::Client
- Inherits:
-
Object
- Object
- HardWorker::Client
- Defined in:
- lib/hard_worker/client.rb
Instance Attribute Summary collapse
-
#queue ⇒ Object
Returns the value of attribute queue.
Instance Method Summary collapse
-
#initialize ⇒ Client
constructor
A new instance of Client.
- #perform_belated(job) ⇒ Object (also: #perform_later)
Constructor Details
#initialize ⇒ Client
Returns a new instance of Client.
5 6 7 8 9 |
# File 'lib/hard_worker/client.rb', line 5 def initialize server_uri = HardWorker::URI DRb.start_service self.queue = DRbObject.new_with_uri(server_uri) end |
Instance Attribute Details
#queue ⇒ Object
Returns the value of attribute queue.
3 4 5 |
# File 'lib/hard_worker/client.rb', line 3 def queue @queue end |
Instance Method Details
#perform_belated(job) ⇒ Object Also known as: perform_later
11 12 13 |
# File 'lib/hard_worker/client.rb', line 11 def (job) queue.push(job) end |