[Twisted-Python] inlineCallbacks as a blocking approximator (stylistic)

Manish Tomar manish.tomar at gmail.com
Mon Oct 3 23:03:16 MDT 2016


On Mon, Oct 3, 2016 at 8:55 PM, Oon-Ee Ng <ngoonee.talk at gmail.com> wrote:

> Is this as 'good' (for the subjective readability concern) as it gets?
> I'm basically going for sufficient readability that my UI code can be
> read by programmers stuck in a synchronous mindset.
I was on synchronous mindset before learning Twisted and did not
like/understand Deferred. The `yield` based statement really helped me
initially but more importantly over time I liked seeing an explicit
difference between blocking vs non-blocking code. When I see `a =
yield func()`, I immediately register the fact that this is a
time-consuming operation which helps in understanding the performance
of the system. So, yes it is a good start for synchronous mindset
people.




More information about the Twisted-Python mailing list