TibrvCmQueueTransport::create()
Method
Declaration
TibrvStatuscreate
(
TibrvTransport* transport,
const char* cmName,
tibrv_u32 workerWeight = TIBRVCM_DEFAULT_WORKER_WEIGHT,
tibrv_u32 workerTasks = TIBRVCM_DEFAULT_WORKER_TASKS,
tibrv_u16 schedulerWeight = TIBRVCM_DEFAULT_SCHEDULER_WEIGHT,
tibrv_f64 schedulerHeartbeat = TIBRVCM_DEFAULT_SCHEDULER_HB,
tibrv_f64 schedulerActivation = TIBRVCM_DEFAULT_SCHEDULER_ACTIVE );
Purpose
Create a transport as a distributed queue member.
Remarks
This method creates a new C distributed queue member, and stores it in the C++ object.
The new TibrvCmQueueTransport must employ a valid TibrvTransport for network communications.
Parameter |
Description |
||||||
|
The new TibrvCmQueueTransport employs this TibrvTransport object for network communications. Destroying the TibrvCmQueueTransport does not affect this transport. |
||||||
|
Bind this reusable name to the new transport object, which becomes a member of the distributed queue with this name. The name must be non- For more information, see Reusable Names in . |
||||||
|
When the scheduler receives a task, it assigns the task to the available worker with the greatest worker weight. A worker is considered available unless either of these conditions are true:
When omitted, the default value is |
||||||
|
Task capacity is the maximum number of tasks that a worker can accept. When the number of accepted tasks reaches this maximum, the worker cannot accept additional tasks until it completes one or more of them. When the scheduler receives a task, it assigns the task to the worker with the greatest worker weight—unless the pending tasks assigned to that worker exceed its task capacity. When the preferred worker has too many tasks, the scheduler assigns the new inbound task to the worker with the next greatest worker weight. The value must be a non-negative integer. When omitted, the default value is Zero is a special value, indicating that this distributed queue member is a dedicated scheduler (that is, it never accepts tasks). Warning Tuning task capacity to compensate for communication time lag is more complicated than it might seem. Before setting this value to anything other than 1, see Task Capacity in . |
||||||
|
Weight represents the ability of this member to fulfill the role of scheduler, relative to other members with the same name. Cooperating members use relative scheduler weight values to elect one member as the scheduler; members with higher scheduler weight take precedence. When omitted, the default value is Acceptable values range from 0 to 65535. Zero is a special value, indicating that the member can never be the scheduler. For more information, see Rank and Weight in . |
||||||
|
The scheduler sends heartbeat messages at this interval (in seconds). All TibrvCmQueueTransport objects with the same name must specify the same value for this parameter. The value must be strictly positive. To determine the correct value, see Step 4: Choose the Intervals in . When omitted, the default value is |
||||||
|
When the heartbeat signal from the scheduler has been silent for this interval (in seconds), the cooperating member with the greatest scheduler weight takes its place as the new scheduler. All TibrvCmQueueTransport objects with the same name must specify the same value for this parameter. The value must be strictly positive. To determine the correct value, see Step 4: Choose the Intervals in . When omitted, the default value is |
Constant |
Value |
|
|
|
|
|
|
|
|
|
|
|
|
See Also
TibrvCmQueueTransport::destroy()
Distributed Queue, in