Class: Workling::Clients::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/workling/clients/base.rb

Direct Known Subclasses

AmqpClient, MemcacheQueueClient

Instance Method Summary collapse

Instance Method Details

#closeObject

Closes the connection to the job broker.

Raises:

  • (NotImplementedError)


49
50
51
# File 'lib/workling/clients/base.rb', line 49

def close
  raise NotImplementedError.new("Implement close() in your client. ")
end

#connectObject

Opens a connection to the job broker.

Raises:

  • (NotImplementedError)


42
43
44
# File 'lib/workling/clients/base.rb', line 42

def connect
  raise NotImplementedError.new("Implement connect() in your client. ")
end

#request(work_type, arguments) ⇒ Object

Requests a job on the broker.

work_type: 
arguments: the argument to the worker method

Raises:

  • (NotImplementedError)


17
18
19
# File 'lib/workling/clients/base.rb', line 17

def request(work_type, arguments)
  raise NotImplementedError.new("Implement request(work_type, arguments) in your client. ")
end

#retrieve(work_uid) ⇒ Object

Gets job results off a job broker. Returns nil if there are no results.

worker_uid: the uid returned by workling when the work was dispatched

Raises:

  • (NotImplementedError)


26
27
28
# File 'lib/workling/clients/base.rb', line 26

def retrieve(work_uid)
  raise NotImplementedError.new("Implement retrieve(work_uid) in your client. ")
end

#subscribe(work_type) ⇒ Object

Subscribe to job results in a job broker.

worker_type:

Raises:

  • (NotImplementedError)


35
36
37
# File 'lib/workling/clients/base.rb', line 35

def subscribe(work_type)
  raise NotImplementedError.new("Implement subscribe(work_type) in your client. ")
end