4 ms·
asyncio is amazing. It has been way faster and more predictable. Home Assistant has a lot of small tasks running all the time with the occasional task taking a
by balloob 9y ago
asyncio is amazing. It has been way faster and more predictable. Home Assistant has a lot of small tasks running all the time with the occasional task taking a long time (ie. trying to reach a device which has been turned off). The number of tasks running simultaneously used to be limited by the size of the thread worker pool, which is no longer the case. A request taking a long time is now just a coroutine pending result in our event loop.
We still offer the old API on top of asyncio, so we have been able to incrementally transition. By now the core and important components are all fully asyncio. Most integrations are not.
- Dowwie 9y agothis would be another great talk.. consider! :)
- balloob 9y agoI submitted a talk proposal for PyCon 2016 about this but was not selected.
- vonseel 9y agoDude. A blog post on writing application on top of asyncio which may interchangeably use threads or async/await, and incrementally making the switch to asyncio would be awesome. I work with a large-fintech platform which is partially powered by Python. Our old server was based around threads, queues, and socket multiplexing but we are gradually starting new applications in asyncio. I recently completed a project in aiohttp which has been fantastic. What are your thoughts on aiohttp vs tornado?
- balloob 9y agoI have not used tornado but I love aiohttp. it's super fast (part in cython) and does HTTP + websocket client and server. Their team is are part of the asyncio contributors, they know their stuff.