[PEAK] Re: Trellis and B3

Phillip J. Eby pje at telecommunity.com
Mon Dec 31 12:10:52 EST 2007


At 12:43 AM 12/31/2007 -0600, Mike Thornton wrote:
>Hi Phillip,
>
>I've just looked at Trellis for an event driven framework and I'm
>trying to get my mind wrapped around it. I'm the primary author of Big
>Brother Bot aka B3 (www.bigbrotherbot.com), a Python application for
>game administration. I'm working on version 2.0, a total rewrite, and
>am looking to see if Trellis will work out for it. Most of what B3
>does is read a log file in real time for event log lines. The event
>lines are translated into objects which are passed through a chain of
>plugins which veto, alter, or act on the event. I'm working on
>splitting this into Input (the log files - or any other source such as
>a web administration), Input parsers (turn input into system objects),
>mangle plugins (alter events if needed - authorize a user or veto an
>event), and output plugins (sends data to the user or stores a value
>in the DB). I'd like to know how to use Trellis for the event
>management in this manner. I plan to do some experimenting but would
>appreciate any jump start you can give me.

I'm not sure if this is really what I'd consider an "event-driven" 
architecture.  It sounds more like a pattern matching 
architecture.  However, if individual plugins are managing state and 
have e.g. timeouts and the like, you might find some use for trellis 
components there.  Your main architecture wouldn't need to do 
anything special to support that, unless the plugins wanted to run 
pseudo-threaded generators.  (In which case you'd need to provide an 
EventLoop service, which is pretty simple to implement.)

Of course, you also can do the pattern matching using the trellis as 
a subscription mechanism, in which case you'd simply have components 
with rules that read the outputs from other components.  Most likely, 
you will use "discrete" rules and "receiver" cells to represent your 
mostly-transient data, only using normal rules and "value" cells when 
you are representing ongoing state (as opposed to occurrences).

(By the way, please don't send me off-list email regarding my open 
source projects: there's a reason my personal email address is NOT 
listed as a contact address on PyPI or on any of my project web 
pages.  Email regarding all PEAK projects (except setuptools) should 
be directed to the PEAK mailing list, peak "at" eby-sarna.com.)




More information about the PEAK mailing list