[Twisted-Python] Sequential use of asynchronous calls
Ben Artin
ben at artins.org
Sun May 27 04:44:22 EDT 2007
Just a quick followup with something that I think I didn't state
clearly in my previous email:
My mental model is that:
- What I am writing are cooperative scheduled coroutines using
Python yield statements
- Deferreds are an implementation detail of those coroutines, and
completely invisible to me
Because of this, saying "@inlineCallbacks", or "@sequential", or, as
I called it, simply "@async" in front of a function is what matters
when I am writing the code. I do not think about Deferreds when I am
writing code. Your argument that @inlineCallbacks should error if
given a "plain" function is a valid one from a "but you could just
write your code differently" perspective, but the result is that my
code no longer matches my mental model, because now I suddenly have
to care about an implementation detail of @inlineCallbacks (namely,
that the function it wraps has to yield even if it's merely to yield
a None at the end).
Ben
--
<http://artins.org/ben>
"Love is an epic-level challenge." -- Durkon
More information about the Twisted-Python
mailing list