
Oct. 18, 2016
12:50 p.m.
Not been doing much Twisted lately, but have been doing async stuff elsewhere, and I've learned some useful things. 1. Callbacks should be sync or async, but never sometimes-one-sometimes-the-other. For details go read http://blog.ometer.com/2011/07/24/callbacks-synchronous-and-asynchronous/. For example, Deferred.addCallback(f) really should never run f() immediately. 3. By instrumenting all callbacks it manages, which may or may not require item #1, Twisted can have a context that automatically follows callbacks. Node has this and it is extremely useful. http://fredkschott.com/post/2014/02/conquering-asynchronous-context-with-cls... is best summary I've found with a bit of searching. -- Itamar Turner-Trauring