Property | Type | Description | |
---|---|---|---|
id | int |
Method | Description | |
---|---|---|
Worker ( ) |
Creates a new worker and assigns it a unique id. Workers should be reused throuout the execution time rather than being destroyed and recreated.
|
|
assignJob ( IJob job ) : void |
Assigns this worker a job which gets inserted into the worker's job queue.
|
|
getWorkerCount ( ) : int |
Returns the count of all created workers since application start.
|
|
join ( ) : void |
Puts the calling thread to sleep, until the worker has finished all his work.
|
|
start ( ) : void |
Starts this worker's every day work described in the class summary.
|
Method | Description | |
---|---|---|
doWork ( ) : void |
(Fetch job -> execute -> sleep)-loop described in the class summary.
|
public assignJob ( IJob job ) : void | ||
job | IJob | The job to be exectued by the worker. |
return | void |