Changeset 131

Show
Ignore:
Timestamp:
05/24/06 07:31:27 (2 years ago)
Author:
blackhedd
Message:

notes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • experiments/machine/test/NOTES

    r130 r131  
    11$Id$ 
     2 
     3---------------------------------------------------------------------- 
     424May06: 
     5 
     6Implementation notes: 
     7 
     8An EventDispatcher is an event queue plus a manager for a chain 
     9of handlers, plus a method for iterating over the queue (which 
     10consumes the events by feeding them into the handler chain). 
     11 
     12How are callbacks defined in such a model? We've been assuming 
     13we need them because Twisted has them, but most of their functionality 
     14is probably present in the handler mechanism we already have. 
     15The exception: sending responses to events, but we still haven't defined 
     16any event types that need to be responded to. (That will come soon enough.) 
     17Rather than a callback, we may want to send another event that is somehow 
     18correlated with the first one. 
     19 
     20The Timeout class defines a straightforward Dispatcher, but it bothers 
     21me that it adds a custom implementation of add_handler. Did you do this 
     22only to sugar the :timer_expired event type? Or is there a more fundamental 
     23reason? 
     24 
     25Timeout adds an construct that is orthogonal to EventDispatcher in 
     26order to get the timing basis. This is the combination of register_timer, 
     27the priority queue, and the fire_timers method which has to be invoked by 
     28the reactor. Something analogous has to be defined for I/O Dispatchers. 
     29 
     30Why do you need the external PQueue implementation? For one thing, it's 
     31GPL and we need EventMachine to be either Ruby-licensed or LGPL. 
     32But what does PQueue give you that couldn't get simply by adding timers to 
     33a Ruby array and then calling sort! {|a,b| a.expiration <=> b.expiration}? 
    234 
    335----------------------------------------------------------------------