#include <worker.h>
Contains information about a worker machine.
Definition at line 147 of file worker.h.
§ request_ptr
Pointer to evauate request type.
Definition at line 151 of file worker.h.
§ worker()
worker::worker |
( |
const std::string & |
id, |
|
|
const std::string & |
hwgroup, |
|
|
const std::multimap< std::string, std::string > & |
headers |
|
) |
| |
- Parameters
-
id | Worker unique identifier. |
hwgroup | Worker handrware group identifier. |
headers | Headers describing worker capabilities. |
Definition at line 89 of file worker.cpp.
§ ~worker()
Stated for completion.
Definition at line 106 of file worker.cpp.
§ cancel_request()
Consider the current request failed. Called when the worker machine fails to process the request. The machine is then considered free.
- Returns
- a pointer to the cancelled request
Definition at line 121 of file worker.cpp.
§ check_header()
bool worker::check_header |
( |
const std::string & |
header, |
|
|
const std::string & |
value |
|
) |
| |
|
virtual |
Check if the worker satisfies given header.
- Parameters
-
header | Name of the header. |
value | Value to be checked against the header. |
Definition at line 170 of file worker.cpp.
§ complete_request()
void worker::complete_request |
( |
| ) |
|
|
virtual |
Consider the current request complete. Called when the actual worker machine successfully processes the request.
Definition at line 115 of file worker.cpp.
§ enqueue_request()
Insert a request into the workers queue.
- Parameters
-
request | A pointer to the request. |
Definition at line 110 of file worker.cpp.
§ get_current_request()
std::shared_ptr< const request > worker::get_current_request |
( |
| ) |
const |
|
virtual |
Get the request that is now being processed.
- Returns
- Pointer to currently processed request or nullptr.
Definition at line 146 of file worker.cpp.
§ get_description()
std::string worker::get_description |
( |
| ) |
const |
Get a textual description of the worker
- Returns
- textual description of the worker
Definition at line 191 of file worker.cpp.
§ headers_equal()
bool worker::headers_equal |
( |
const std::multimap< std::string, std::string > & |
other | ) |
|
Check if the worker's headers are equal to given set of headers
- Parameters
-
other | The set of headers to check |
Definition at line 186 of file worker.cpp.
§ next_request()
bool worker::next_request |
( |
| ) |
|
|
virtual |
If possible, take a request from the queue and start processing it.
- Returns
- true if and only if the worker started processing a new request.
Definition at line 133 of file worker.cpp.
§ terminate()
Forget all requests (currently processed and queued). Called when the worker is considered dead.
- Returns
- Current request and all requests from waiting queue.
Definition at line 151 of file worker.cpp.
§ description
std::string worker::description = "" |
An optional human readable description
Definition at line 174 of file worker.h.
§ hwgroup
const std::string worker::hwgroup |
A hardware group identifier.
Definition at line 177 of file worker.h.
§ identity
const std::string worker::identity |
A unique identifier of the worker.
Definition at line 171 of file worker.h.
§ liveness
The amount of pings the worker can miss before it's considered dead.
Definition at line 180 of file worker.h.
The documentation for this class was generated from the following files: