Class: HardWorker::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/hard_worker/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeClient

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

#queueObject

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 perform_belated(job)
  queue.push(job)
end