[Twisted-Python] integrating CompStrm//adding background processing
Christopher Armstrong
radix at twistedmatrix.com
Mon May 17 01:07:21 EDT 2004
Bill la Forge wrote:
> It isn't that I want to call a function with a particular frequency.
> Rather,
> I want to call a function once per main loop. Further, when the function
> is available to be called, I want to run with a timeout of 0 to further
> increase the frequency of calls. LoopingCall still uses callLater which
> simply can not deliver this type of service.
>
> My view on things is that, while blocking I/O is best put in another
> thread, computations that can be broken into small pieces (putting
> yield statements in every loop, for example) can run very nicely in the
> background. Between each chunck of processing, you check for any
> timer events and for I/O completions, of course. But you want to execute
> these small chuncks AS FREQUENTLY AS POSSIBLE.
>
> But like I said, I'm developing a new style of async programming. So
> its bound to be something of a heresy. ;-)
Indeed, it sounds like what you're doing doesn't make any sense. Why do
you need to call something every mainloop iteration? That's exactly the
worst way to write asynchronous code. Polling sucks. :)
Maybe you can explain more about what you're doing? What *applications*
do you have in mind that this thing would be good for? (I notice that
your web site's first sentence mentions how great it would be to create
applications from components, but the web site doesn't mention anything
at all about existing or even theoretical applications).
--
Twisted | Christopher Armstrong: International Man of Twistery
Radix | Release Manager, Twisted Project
---------+ http://radix.twistedmatrix.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20040517/bb01f9e4/attachment.pgp
More information about the Twisted-Python
mailing list