Why not us an asyncio queue so you can just have a loop in a task
instead of a recurring task?
Ah, ok. Thanks! I need to read up on asyncio queues.
Also: Autobahn now works with above design (and I have 95% shared code
between Twisted and asyncio), but is this how you intended asyncio to be
used, or am I misusing / not following best practice in some way? I am
totally new to asyncio, coming from Twisted ..
Seems to me as if perhaps you are trying to find ways to combine
asyncio operations to implement the primitives you are familiar with
from Twisted, rather than figuring out how to best solve your
Yeah, I've grown up event driven: from C++/ACE, C++/Boost/ASIO to Twisted.
underlying problem using asyncio. Using asyncio, your best approach is
to think of how you would do it in a sequential world using blocking
I/O, then use coroutines and yield-from for the blocking I/O, then
think about how to introduce some parallelism where you have two
independent blocking operations that don't depend on each other.
Indeed event-driven ("push style") feels more "natural" for me. Writing
"synchronous" ("pull-style") code is a stretch to me. In fact, other
stuff I work with (besides Twisted) is also event-driven, like
JavaScript or Android.
/Tobias