NAME
Tibco::Rv::Dispatcher - Tibco Queue dispatching thread
SYNOPSIS
$queue = $rv->createQueue;
$dispatcher = new Tibco::Rv::Dispatcher( dispatchable => $queue );
DESCRIPTION
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.
CONSTRUCTOR
- $dispatcher = new Tibco::Rv::Dispatcher( %args )
-
%args: dispatchable => $dispatchable, name => $name, idleTimeout => $idleTimeoutCreates a
Tibco::Rv::Dispatcher. If not specified, dispatchable defaults to the Default Queue, name defaults to 'dispatcher', and idleTimeout defaults toTibco::Rv::WAIT_FOREVER.Upon creating
$dispatcher, it starts a separate thread, which repeatedly callstimedDispatchon$dispatchable, passing it the$idleTimeoutvalue. The thread exits after$idleTimeoutseconds have passed without any events being placed on the$dispatchable.$idleTimeoutcan specify fractional seconds.If
$idleTimeoutisTibco::Rv::WAIT_FOREVER(the default value), then$dispatchercontinues dispatching events until DESTROY is called or the program exits -- when no events are waiting on the$dispatchablein this case,$dispatchersimply blocks. If$idleTimeoutisTibco::Rv::NO_WAIT, then$dispatcherdispatches events until no events are waiting on$dispatchable, at which point the thread exits.
METHODS
- $dispatchable = $dispatcher->dispatchable
-
Returns the Queue or QueueGroup that
$dispatcheris dispatching events on. - $idleTimeout = $dispatcher->dispatchable
-
Returns the idleTimeout value
$dispatcheris using to calltimedDispatchon its dispatchable. - $name = $dispatcher->name
-
Returns the name of
$dispatcher. - $dispatcher->name( $name )
-
Sets
$dispatcher's name to$name. Use this to distinguish multiple dispatchers and assist troubleshooting. If$nameisundef, sets name to ''. - $dispatcher->DESTROY
-
Exits the thread and destroys
$dispatcher. Called automatically at program exit.
SEE ALSO
AUTHOR
Paul Sturm <sturm@branewave.com>