common.messagerouting (version 0.1, 9 April 2003)
index
e:\bothans\common\messagerouting.py

MessageRouting Management

 
Modules
            
logging
thread
threading
 
Classes
            
threading.Thread(threading._Verbose)
MessageRouter
 
class MessageRouter(threading.Thread)
       This class routes message on a queue to several handler.
 
A handler must have one method
- handleMessage(message)
this method must NOT change the message.
 
To stop the thread put the message MessageRouter.STOP on the queue
Usage:
mr = MessageRouter(10)
mr.start()
mr.addHandler( MyHandler() )
mr.put(message)
mr.stop()
 
  
Method resolution order:
MessageRouter
threading.Thread
threading._Verbose

Methods defined here:
__init__(self, queueSize=10)
 queueSize definit le nombre max. de messages en attente
addHandler(self, handler)
 handler doit repondre a handleMessage(message)
put(self, message)
 enqueues the message for routing
This function could block
rmHandler(self, handler)
run(self)
 ***should not be called***
wait for incoming messages and route them to all handlers
stop(self)
 Ends the running thread
this function returns immediately but the running thread
will not end immediately

Data and non-method functions defined here:
STOP = '__MessageRouter__die__'
__doc__ = ' This class routes message on a queue to several...andler() )\n mr.put(message)\n mr.stop()\n '
__module__ = 'common.messagerouting'

Methods inherited from threading.Thread:
_Thread__bootstrap = __bootstrap(self)
_Thread__delete = __delete(self)
_Thread__stop = __stop(self)
__repr__(self)
_set_daemon(self)
getName(self)
isAlive(self)
isDaemon(self)
join(self, timeout=None)
setDaemon(self, daemonic)
setName(self, name)
start(self)

Data and non-method functions inherited from threading.Thread:
_Thread__initialized = 0

Methods inherited from threading._Verbose:
_note(self, format, *args)
 
Data
             __author__ = 'Michel Rasschaert <mrasschaert@neocles.com>'
__date__ = '9 April 2003'
__file__ = r'e:\bothans\common\messagerouting.pyc'
__license__ = 'This file is part of Bothans\n\n Bothans is fre...lace, Suite 330, Boston, MA 02111-1307 USA\n '
__name__ = 'common.messagerouting'
__status__ = 'alpha'
__version__ = '0.1'
log = <logging.Logger instance at 0x007DFF60>
 
Author
             Michel Rasschaert <mrasschaert@neocles.com>