| Tibco-Rv documentation | view source | Contained in the Tibco-Rv distribution. |
Tibco::Rv::Dispatcher - Tibco Queue dispatching thread
$queue = $rv->createQueue; $dispatcher = new Tibco::Rv::Dispatcher( dispatchable => $queue );
A Tibco::Rv::Dispatcher object is an independent thread that repeatedly
dispatches events waiting on the specified dispatchable. A dispatchable
is either a Tibco::Rv::Queue or a
Tibco::Rv::QueueGroup.
%args:
dispatchable => $dispatchable,
name => $name,
idleTimeout => $idleTimeout
Creates a Tibco::Rv::Dispatcher. If not specified, dispatchable defaults
to the Default Queue, name defaults to
'dispatcher', and idleTimeout defaults to Tibco::Rv::WAIT_FOREVER.
Upon creating $dispatcher, it starts a separate thread, which repeatedly
calls timedDispatch on $dispatchable, passing it the $idleTimeout
value. The thread exits after $idleTimeout seconds have passed without
any events being placed on the $dispatchable. $idleTimeout can
specify fractional seconds.
If $idleTimeout is Tibco::Rv::WAIT_FOREVER (the default value), then
$dispatcher continues dispatching events until DESTROY is called or the
program exits -- when no events are waiting on the $dispatchable in this
case, $dispatcher simply blocks. If $idleTimeout is
Tibco::Rv::NO_WAIT, then $dispatcher dispatches events until no
events are waiting on $dispatchable, at which point the thread exits.
Returns the Queue or QueueGroup
that $dispatcher is dispatching events on.
Returns the idleTimeout value $dispatcher is using to call timedDispatch
on its dispatchable.
Returns the name of $dispatcher.
Sets $dispatcher's name to $name. Use this to distinguish multiple
dispatchers and assist troubleshooting. If $name is undef, sets name
to ''.
Exits the thread and destroys $dispatcher. Called automatically at
program exit.
Paul Sturm <sturm@branewave.com>
| Tibco-Rv documentation | view source | Contained in the Tibco-Rv distribution. |