Ok, I promised this code awhile ago, but I finally got around to actually
posting it.

Here's an example of a counter with a reset.  In the example, the counter
resets at "10".  The actual number it will count up to varies across
examples, because of the "latency" involved.

To see the rough equivalent in 'old' Kamaelia, see
http://pastebin.com/f79885e7c
For the proposed 'new' style, see http://pastebin.com/f320c4f08
Finally, the code that (partially) implements the 'new' style
(component.py):  http://pastebin.com/f3c96147b

These are functioning examples -- i.e., they will run if you execute them.

Note that component.py creates a backplane for each output.  This is so you
can plug multiple inputs into it.  This increases the message "latency".

The code currently uses descriptor classes for the inputs/outputs.  I'm not
sure if this is supported on 2.2 or not.  If anyone is really concerned
about this, it would also be possible to use getattr/setattr to accomplish
the same goal.

So, I'm interested in comments:  Does this make components easier to code
and wire?  Is it worth going further with this and implementing, for
example, passthrough links?  What other features would make things even
easier?

Thanks,

Nathan Davis

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

Reply via email to