fwRPC
|
Functions | |
dyn_mixed | fwRPC_workerModel_new (int id, int status=fwRPC_WORKER_STATUS_NONE, int jobs=0, bool locked=false) |
bool | fwRPC_workerModel_isValid (dyn_mixed worker) |
bool | fwRPC_workerModel_canProcess (dyn_mixed worker, bool funcIsExclusive) |
bool | fwRPC_workerModel_isIdle (dyn_mixed worker) |
string | fwRPC_workerModel_toString (dyn_mixed worker) |
string | fwRPC_workerModel_status_toString (int status) |
Variables | |
const int | fwRPC_WORKER_MAX_JOBS = 25 |
const int | fwRPC_WORKER_HEARTBEAT_WAIT_S = 60 |
const int | fwRPC_WORKER_HEARTBEAT_RATE_MS = 2000 |
const int | fwRPC_WORKER_STATUS_NONE = 1 |
const int | fwRPC_WORKER_STATUS_READY = 2 |
const int | fwRPC_WORKER_STATUS_PENDINGRUN = 3 |
const int | fwRPC_WORKER_STATUS_WORKING = 4 |
const int | fwRPC_WORKER_STATUS_ERROR = 5 |
const int | fwRPC_WORKER_STATUS_DEAD = 6 |
const int | fwRPC_WORKER_STATUS_RESTARTING = 7 |
const int | fwRPC_WORKER_STATUS_MAXIDX = 8 |
const int | fwRPC_WORKER_MODEL_ID = 1 |
const int | fwRPC_WORKER_MODEL_STATUS = 2 |
const int | fwRPC_WORKER_MODEL_JOBS = 3 |
const int | fwRPC_WORKER_MODEL_LOCKED = 4 |
const int | fwRPC_WORKER_MODEL_LASTHB = 5 |
const int | fwRPC_WORKER_MODEL_HBTID = 6 |
const int | fwRPC_WORKER_MODEL_PEND_RESTART = 7 |
const int | fwRPC_WORKER_MODEL_MAXIDX = 8 |
This library contains constants and functionality for workers, including DP, query, and model information. Also includes functionality for worker model initialization and synchronization.
bool fwRPC_workerModel_canProcess | ( | dyn_mixed | worker, |
bool | funcIsExclusive | ||
) |
Return whether or not a given worker is available for work given it's status (e.g., if it is not currently locked in execution), and the exclusive execution requirements of the request, if any.
worker | (IN, dyn_mixed) worker to check |
exclusiveExec | (IN, bool) whether the request required exclusive execution. |
nothing |
bool fwRPC_workerModel_isIdle | ( | dyn_mixed | worker | ) |
Return whether or not the worker is idle. Note that whether the worker is pending a restart or not is ignored in this evaluation.
worker | (IN, dyn_mixed) worker object |
nothing |
bool fwRPC_workerModel_isValid | ( | dyn_mixed | worker | ) |
Check if the given object is a valid worker object. Throws an exception if not.
worker | (IN, dyn_mixed) object to check |
if | the given object is not a valid worker object |
dyn_mixed fwRPC_workerModel_new | ( | int | id, |
int | status = fwRPC_WORKER_STATUS_NONE , |
||
int | jobs = 0 , |
||
bool | locked = false |
||
) |
Construct a worker object.
id | (IN, int) Worker ID |
status | (IN, int) Initial status |
jobs | (IN, int) Initial job count |
locked | (IN, bool) Initial lock status |
nothing |
const int fwRPC_WORKER_HEARTBEAT_RATE_MS = 2000 |
Worker heartbeat parameters
const int fwRPC_WORKER_HEARTBEAT_WAIT_S = 60 |
Worker heartbeat parameters
const int fwRPC_WORKER_MAX_JOBS = 25 |
Maximum number of jobs to be executed concurrently by a single worker.
const int fwRPC_WORKER_MODEL_HBTID = 6 |
Worker model indexes
const int fwRPC_WORKER_MODEL_ID = 1 |
Worker model indexes
const int fwRPC_WORKER_MODEL_JOBS = 3 |
Worker model indexes
const int fwRPC_WORKER_MODEL_LASTHB = 5 |
Worker model indexes
const int fwRPC_WORKER_MODEL_LOCKED = 4 |
Worker model indexes
const int fwRPC_WORKER_MODEL_MAXIDX = 8 |
Worker model indexes
const int fwRPC_WORKER_MODEL_PEND_RESTART = 7 |
Worker model indexes
const int fwRPC_WORKER_MODEL_STATUS = 2 |
Worker model indexes
const int fwRPC_WORKER_STATUS_DEAD = 6 |
States in which a worker can be in
const int fwRPC_WORKER_STATUS_ERROR = 5 |
States in which a worker can be in
const int fwRPC_WORKER_STATUS_MAXIDX = 8 |
States in which a worker can be in
const int fwRPC_WORKER_STATUS_NONE = 1 |
States in which a worker can be in
const int fwRPC_WORKER_STATUS_PENDINGRUN = 3 |
States in which a worker can be in
const int fwRPC_WORKER_STATUS_READY = 2 |
States in which a worker can be in
const int fwRPC_WORKER_STATUS_RESTARTING = 7 |
States in which a worker can be in
const int fwRPC_WORKER_STATUS_WORKING = 4 |
States in which a worker can be in