eventqueue.rb

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.

Synopsis

  require 'mues/eventqueue'

  queue = MUES::EventQueue.new( 2, 10, 1.5, 2 )
  queue.enqueue( *events )

Subversion ID

$Id: eventqueue.rb 1215 2004-06-14 06:02:09Z deveiant $

Authors

  • Michael Granger <ged@FaerieMUD.org>

Copyright

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.

Required files

thread   mues/object   mues/workerthread   mues/exceptions   mues/events  

[Validate]