The Incredible Growth of Python (stackoverflow.blog)

Michael Torrie torriem at gmail.com
Mon Sep 11 23:03:49 EDT 2017


On 09/11/2017 08:36 AM, Dennis Lee Bieber wrote:
> On Mon, 11 Sep 2017 18:35:02 +1000, Chris Angelico <rosuav at gmail.com>
> declaimed the following:
> 
>>
>> Do a quick poll here on the list. Who sees async functions as an
>> alternative to Twisted? Who here has even *used* Twisted? (How many
>> even know what it is?)
>>
> 	Tried to read the Twisted documentation back when it was the new
> mousetrap... Couldn't get my head to understand it then, never looked back.
> Threading has worked well for everything I've done (granted, the most
> recent "major" effort involved two threads each reading Wireshark captures,
> parsing out specific packets, and forwarding them to a third thread via
> Queues, so the third thread could match sent vs rcvd and compute time
> differences, writing results to SQLite3).

I know the feeling.  However once it clicks, Twisted isn't that hard to
understand in abstract.  Data event happens, data is passed to a chain
of callbacks. The output of one handler is passed as input to the next.
Think of it a bit like chaining generator functions.  If an exception
occurs along the way, execution shifts from the callback chain to an
error handling callback chain.  The bit that was hard for me to
understand is that somewhere, somehow, the something has to trigger the
event. That's the magic/hidden part often, buried in layers of
inheritance in the Twisted core.






More information about the Python-list mailing list