Open topic with navigation

TIBCO Rendezvous® 8.7.0

# TibrvQueue

Class

## Declaration

    class TibrvQueue : TibrvDispatchable
        TibrvQueue();             // Construct empty.
        virtual ~TibrvQueue();    // Destroy and reclaim storage.

## Purpose

Event queue.

## Remarks

Each event is associated with a TibrvQueue object; when the event occurs, Rendezvous software places the event object in its queue. Programs dispatch queues to process events.

The constructor produces a hollow object; TibrvQueue::create() makes it operational.

The destructor calls the `destroy` method, unless the C object is already destroyed.

## Default Queue

The method Tibrv::defaultQueue() returns a pre-defined queue. Programs that need only one event queue can use this default queue (instead of using TibrvQueue::create() to create one). The default queue has priority 1, can hold an unlimited number of events, and never discards an event (since it never exceeds an event limit).

Rendezvous software places all advisories pertaining to queue overflow on the default queue.

Programs must not destroy the default queue, except as a side effect of Tibrv::close(). Programs cannot change the parameters of the default queue.

## Limit Policy

These constants specify the possible strategies for resolving overflow of queue limit.

Constant | Description
`TIBRVQUEUE_DISCARD_NONE` | Never discard events; use this policy when a queue has no limit on then number of events it can contain.
`TIBRVQUEUE_DISCARD_FIRST` | Discard the first event in the queue (that is, the oldest event in the queue, which would otherwise be the next event to dispatch).
`TIBRVQUEUE_DISCARD_LAST` | Discard the last event in the queue (that is, the youngest event in the queue).
`TIBRVQUEUE_DISCARD_NEW` | Discard the new event (which would otherwise cause the queue to overflow its maximum events limit).

Method | Description
Life Cycle
TibrvQueue::create() | Create an event queue.
TibrvQueue::destroy() | Destroy an event queue.
TibrvQueue::getHandle() | Extract the C handle of this queue.
TibrvQueue::isValid() | Test validity of a queue.
Dispatch
TibrvQueue::dispatch() | Dispatch an event; if no event is ready, block.
TibrvQueue::poll() | Dispatch an event, if possible.
TibrvQueue::timedDispatch() | Dispatch an event, but if no event is ready to dispatch, limit the time that this call blocks while waiting for an event.
Properties
TibrvQueue::getCount() | Extract the number of events in a queue.
TibrvQueue::getLimitPolicy() | Extract the limit properties of a queue.
TibrvQueue::getName() | Extract the name of a queue.
TibrvQueue::getPriority() | Extract the priority of a queue.
TibrvQueue::setName() | Set the name of a queue.
TibrvQueue::setLimitPolicy() | Set the limit properties of a queue.
TibrvQueue::setPriority() | Set the priority of a queue.

Inherited Methods
`TibrvDispatchable::getDispatchable()` TibrvDispatchable::destroy() TibrvDispatchable::dispatch() TibrvDispatchable::isValid() TibrvDispatchable::poll() TibrvDispatchable::timedDispatch()

## Related Classes

TibrvDispatchable

TibrvQueueGroup

Subtopics

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO Rendezvous®

Copyright © 1997-2023. Cloud Software Group, Inc. All Rights Reserved.