5 ms·
Great, the support is still basic, but it's a huge improvement over message passing when you need speed. 2 months ago a student asked me exactly that question:
by sametmax 8y ago
Great, the support is still basic, but it's a huge improvement over message passing when you need speed. 2 months ago a student asked me exactly that question: how to share data between processes, and when I told him that with the stdlib he had to manipulate mmap by hand (https://blog.schmichael.com/2011/05/15/sharing-python-data-between-processes-using-mmap/ https://blog.schmichael.com/2011/05/15/sharing-python-data-b...), he was not happy.
Now that asyncio is production ready (we really have had a decent doc and asyncio.run() for a short time), and this, the concurrency story in Python is starting to look decent.
Since the 3.6, things are really going nicely.
Maybe we'll see an async django-like framework emerging from now on instead of the myriad of async flask copycat and django-channels. This would open the gate to live settings, manipulating tasks queues in URL enpoints, having RPC/PUB-SUB baked in. After all, I don't need async to just have exactly the same features as a WSGI framework.
- m_ke 8y agoTom Christie (DRF dev) is working on an async django like toolchain with starlette, databases and uvicorn. https://twitter.com/_tomchristie/status/1100064076191940608 https://twitter.com/_tomchristie/status/1100064076191940608 Hopefully django will start supporting asgi soon and let us write async views alongside existing sync stuff.
- ausjke 8y ago"decent doc and asyncio.run() for a short time" -- can you give a URL or some pointers? Thanks.
- sametmax 8y agoStarting from 3.7, the documentation is much, much better (https://docs.python.org/3/library/asyncio.html https://docs.python.org/3/library/asyncio.html compared to https://docs.python.org/3.6/library/asyncio.html https://docs.python.org/3.6/library/asyncio.html). As you'll notice, we now can start program with a simple asyncio.run() instead of manually setuping the event loop. Not only it is less verbose and easier, it's also much less error prone. It should have been in asyncio from the begining, but even a long fight on python-ideas didn't work. Fortunatly, Yuri decided to add on his own.
- ausjke 8y agothanks, very helpful
- j88439h84 8y agoI like http://trio.rtfd.org http://trio.rtfd.org way more than asyncio.
- sametmax 8y agoMe too, although the scheduling syntax is not to my taste. But trio is not in the stdlib, and is incompatible with most of the current ecosystem. There are talks to integrate it in the future, meanwhile there are compat layers, but it's still in infancy. For now on, I just use asyncio with a lib to add nurseries to it.
- j88439h84 8y agoI'm curious what you dont like about the syntax, and which parts of the ecosystem you're waiting on?