TibrvQueue.setLimitPolicy()

Method

Declaration

void setLimitPolicy(
    int limitPolicy,
    int maxEvents,
    int discardAmount)
  throws TibrvException

Purpose

Set the limit properties of a queue.

Remarks

This method simultaneously sets three related properties, which together describe the behavior of a queue in overflow situations. Each call must explicitly specify all three properties.

Parameter

Description

limitPolicy

Each queue has a policy for discarding events when a new event would cause the queue to exceed its maxEvents limit. Choose from the values of Limit Policy.

When maxEvents is zero (unlimited), the policy must be TibrvQueue.DISCARD_NONE.

maxEvents

Programs can limit the number of events that a queue can hold—either to curb queue growth, or implement a specialized dispatch semantics.

Zero specifies an unlimited number of events; in this case, the policy must be TibrvQueue.DISCARD_NONE.

discardAmount

When the queue exceeds its maximum event limit, discard a block of events. This property specifies the number of events to discard.

When discardAmount is zero, the policy must be TibrvQueue.DISCARD_NONE.

See Also

TibrvQueue.getDiscardAmount()

TibrvQueue.getLimitPolicy()

TibrvQueue.getMaxEvents()