[Baypiggies] Web Crawler/Backend Engineer - San Francisco, CA
Jeremy Fishman
jeremy.r.fishman at gmail.com
Thu Feb 4 05:54:13 CET 2010
I'm a big fan of Twisted, though I don't know much what's going on there
right now (they're overdue on their 2010 release -
http://twistedmatrix.com/trac/milestone/Twisted-10.0). Most of the team
works for Canonical now I believe.
On the other hand, I find greenlets (http://pypi.python.org/pypi/greenlet)
from Stackless pretty darn cool, although part of me says that they're just
'goto's for Python, which Rich may want to avoid.
And on that note, I too think rich was a bit harsh on 'goto's. I
definitively avoid them in general code, but occasionally they can serve the
opposite purpose than that which their reputation predicts. A goto or two
can clean up very specifically confusing code, such as when a several cases
in a switch statement share different chunks of exit logic, but can't simple
fall through. Sure, setting some flags and 'break'ing, or passing state to
a helper function, would achieve the same thing, but it can clearly be
cleaner and more understandable to 'goto label_foo' in the switch and then
have some nice unindented cleanup labels before the function close.
- Jeremy
--
Jeremy R Fishman
Quantcast Corporation
jeremy.r.fishman at gmail.com
On Wed, Feb 3, 2010 at 7:17 PM, Keith Dart <keith at dartworks.biz> wrote:
> === On Wed, 02/03, K. Richard Pixley wrote: ===
> > What experience do folks have with event based frameworks in python?
> >
> > I was thinking I was going to have to write my own, but I stumbled
> > upon "circuits" today and then read through some of the "twisted" doc
> > and was surprised to find that it closely mirrored my own thoughts.
> >
> > Are there others? Are any of the implementations definitive either
> > positively or negatively?
> ===
>
> Twisted seems pretty good, and is fairly popular for that sort of thing.
>
> Some time ago I wrote one, which is part of Pycopia. I still use that
> one myself. I think I'm the only one... Although the powerdroid project
> also uses it for a test and measurement application (which I also
> wrote).
>
> If you're interested:
>
> http://code.google.com/p/pycopia/
>
> core async module:
>
> http://code.google.com/p/pycopia/source/browse/trunk/core/pycopia/asyncio.py
>
> Which is mostly a simplifying wrapper around the stock "poll" module.
> It defines an interface that the rest of the framework follows. In
> addition to that there is support for timers (the itimer module) that
> work properly in an async environment and proper handling of EAGAIN
> throughout the framework (requires its own socket module, for example).
>
> One example of its use is the SNMP trap receiver:
>
>
> http://code.google.com/p/pycopia/source/browse/trunk/SNMP/pycopia/SNMP/traps.py
>
>
> For powerdroid:
> http://code.google.com/p/powerdroid/
>
> An async example that also uses the realtime clock to pace
> measurements accurately:
>
>
> http://code.google.com/p/powerdroid/source/browse/trunk/src/droid/measure/sequencer.py
>
>
> Then there is (or was) Stackless Python...
>
> -- Keith Dart
>
> --
> -- --------------------
> Keith Dart
> <keith at dartworks.biz>
> =======================
> _______________________________________________
> Baypiggies mailing list
> Baypiggies at python.org
> To change your subscription options or unsubscribe:
> http://mail.python.org/mailman/listinfo/baypiggies
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/baypiggies/attachments/20100203/9e086a4c/attachment-0001.htm>
More information about the Baypiggies
mailing list