Enqueue and Dequeue
A typical Apply process can dequeue both
the captured events and the user-enqueued events. The Apply
process handles all events containing LCR(s) automatically. It
uses the specified rule conditions to apply directly to the
database objects, or it may also use a user specified procedure
to do the transaction processing. When there is no LCR in the
event and there are only user messages, the Apply process reacts
differently. When it can rely only on user messages, the Apply
process can call upon a user-specified procedure to process the
messages. These procedures are called Message Handlers.
User written applications can be developed
and used to explicitly dequeue the user-enqueued events. These
applications may or may not rely upon the Streams messaging
client. It is important to remember that captured events can not
be dequeued by a user application. Only the Apply process is
able to dequeue the captured events. The only technical
exception is when an Apply process calls a user procedure such
as a message handler that enqueues an event explicitly. This
event is considered a user enqueued event and can be dequeued
explicitly even though the event may have originally been a
captured event.
The different types of queues and the
various ways that events can be queued and dequeued are some of
the exciting features of the Streams methodology.