Class: Workling::Clients::Base
- Inherits:
-
Object
- Object
- Workling::Clients::Base
- Defined in:
- lib/workling/clients/base.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#close ⇒ Object
Closes the connection to the job broker.
-
#connect ⇒ Object
Opens a connection to the job broker.
-
#request(work_type, arguments) ⇒ Object
Requests a job on the broker.
-
#retrieve(work_uid) ⇒ Object
Gets job results off a job broker.
-
#subscribe(work_type) ⇒ Object
Subscribe to job results in a job broker.
Instance Method Details
#close ⇒ Object
Closes the connection to the job broker.
49 50 51 |
# File 'lib/workling/clients/base.rb', line 49 def close raise NotImplementedError.new("Implement close() in your client. ") end |
#connect ⇒ Object
Opens a connection to the job broker.
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
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
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:
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 |