On 23.02.2015 14:27, Marko Rauhamaa wrote: > pfranke...@gmail.com: >> The corresponding call is a call to the python smbus library. It >> includes several sleeps (even though they are only about 50ms). >> Therefore I think it is worthwhile to encapsulate it into a coroutine. > > Maybe. Then you'll probably have to rewrite smbus to work asyncio style. > Those sleeps would then be done as "yield from" statements. >
The manual has a word on this [1]. So I would suggest to use run_in_executor() instead of trashing and rewriting the whole smbus library. regards, jwi [1]: https://docs.python.org/3/library/asyncio-dev.html#handle-blocking-functions-correctly [2]: https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.BaseEventLoop.run_in_executor
signature.asc
Description: OpenPGP digital signature
-- https://mail.python.org/mailman/listinfo/python-list