A standard TriggerModel that batches "trigger()"
requests for a single-threaded client Trigger ,
plus provides support for "suspend()/resume()" and
"start()/stop()".
Only one "clientTrigger.trigger()" will be run at a time,
so the client Trigger can be non-synchronized. Trigger
requests are batched -- for example, the first client
request for "this.trigger()" calls the trigger-registry's
"trigger()" (queue), and further "this.trigger()" requests
are ignored until the trigger-registry runs the client's
trigger.
If the "clientTrigger.trigger()" throws an exception then
"halt()" is called -- the model is suspended and stopped,
and the exception is passed back to the trigger-registry.
Note that "suspend()" will wait for a running
"clientTrigger.trigger()" to complete, and if the "suspend()"
is interrupted then the behavior is as if the "suspend()" was
never requested. The same logic goes for "stop()".
See Also: TriggerModel |