eventdelegator.rb

Path: lib/mues/filters/eventdelegator.rb  (CVS)
Last Update: Sat Aug 18 22:54:10 -0700 2007

This file contains the MUES::EventDelegator class, instances of which connect the stream of events in a MUES::IOEventStream to another object. It allows an object to interact with a stream and receive input and/or output events from it without having to be a filter itself.

When the EventDelegator is created, it is given a delegate, which is the object that will be doing the IOEvent processing for it. The delegate should answer either the handleInputEvents or handleOutputEvents methods, or both. Each method will be called with the delegator as the first argument and any events that need to be handled as the remaining arguments, like so:

  delegate.handleInputEvents( delegator, *events )

Any events returned from this call will be passed along in the stream. You can inject your own events into the stream outside of an I/O cycle via the queueOutputEvents and queueInputEvents methods inherited from IOEventFilter, but the events passed to the handlers will include events which have been queued for the delegator.

Synopsis

  require 'mues/filters/eventdelegator'

  delegator = MUES::EventDelegator::new( self )
  delegator.queueOutputEvents( MUES::PromptEvent::new )

Subversion ID

$Id: eventdelegator.rb 1206 2004-05-09 21:25:11Z 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

sync   mues/object   mues/events   mues/exceptions   mues/filters/ioeventfilter  

[Validate]