| Path: | lib/mues/eventqueue.rb (CVS) |
| Last Update: | Sat Aug 18 22:54:10 -0700 2007 |
MUES::EventQueue is a thread work crew/thread pool for dispatching MUES::Engine events (MUES::Event objects). It provides a way of managing the execution of many sequential tasks in a task-per-thread model without the expense of creating and destroying a thread for each event which requires execution. It contains a supervisor thread, which is responsible for maintaining a pool of worker threads which it starts and kills as they become more or less tasked. As events are enqueued (via enqueue), they are retrieved by a worker thread and executed. If the execution of the event creates consequential events, they are dispatched back to the Engine, and the thread goes back into the pool.
require 'mues/eventqueue' queue = MUES::EventQueue.new( 2, 10, 1.5, 2 ) queue.enqueue( *events )
$Id: eventqueue.rb 1215 2004-06-14 06:02:09Z deveiant $
Copyright (c) 2000-2003 The FaerieMUD Consortium. All rights reserved.
This module is free software. You may use, modify, and/or redistribute this software under the terms of the Perl Artistic License. (See language.perl.com/misc/Artistic.html)
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.