Hello,

I wanted to share a few utility components with you that I found
useful in my last Kamaelia program.  My hope is that if others find
these useful they might find their way into subversion or at least
serve as a basis of discussion for similar functionality.  The
attached python file includes the following four components:

PeriodicTick - This component is very similar to
Kamaelia.Util.Clock.CheapAndChearfulClock.  It has three main
improvements over the aforementioned clock.  The first is that
PeriodicTick does not accumulate delay errors over time.  The second
improvement is that PeriodicTick has an optional check_interval
parameter which specifies a time period to periodically check for a
termination signal.  And the last improvement is the shorter name.

SingleTick - This components is like PeriodicTick except that it ends
after a single delay interval.  It does still include the ability to
check for an early termination signal.

TTL - This component's name stands for Time To Live.  It's used to
wrap an existing component and force a shutdown of the wrapped
component after a set period of time.  This is particularly useful for
components that don't have their own built-in timeout functionality.
It uses an embedded SingleTick component to accomplish its task.  The
TTL component exposes all the non-private inboxes and outboxes of the
wrapped component.

DataSink - This component is the inverse of the DataSource component.
While DataSource provides a convenient way to transition data from a
procedural section of code into a Kamaelia pipeline, there was not a
component to easily go the other direction.  To facilitate
transitioning back from Kamaelia managed code into standard procedural
python, I ade the DataSink which takes data received on its inbox and
stores it in a list.  This is by design not thread-safe as it is
intended only to be accessed after the Kamaelia pipeline has
terminated.

I look forward to any thoughts or comments you might have on these components.

-- Steve

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"kamaelia" group.
To post to this group, send email to kamaelia@googlegroups.com
To unsubscribe from this group, send email to 
kamaelia+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/kamaelia?hl=en
-~----------~----~----~----~------~----~------~--~---

Attachment: utilities.py
Description: Binary data

Reply via email to