Hacker News new | past | comments | ask | show | jobs | submit login

I wonder how popular the async interface will become. I use Python and Django extensively but haven't touch any of the async operations.



Once the underlying database queries become async, I can see it becoming popular. Many views do multiple database queries that aren't dependent on each other, which would be a quick win to make async.


Since ultimately anything you build in Django will eventually go into the ORM layer, it won't become anything unless the ORM is fully async. This release brings the async API to it, but:

> Note that, at this stage, the underlying database operations remain synchronous

That kinda defeats the whole purpose of an ASGI app.


>That kinda defeats the whole purpose of an ASGI app.

Unless I’m missing something, wouldn’t an async ORM provide significant benefit for apps with an internet-based DB connection? I would think the underlying DB ops would be much faster than sending a request and waiting on a response.


But you could use it for load not tied to database, isn't it? Like CPU, IO or network bound stuff...


You don't use async for CPU. Python async is actually asyncio, so I/O and network such as calling external API, etc.. It'll make integration much easier to reason about.


I use the event loop to defer the (io heavy) post-processing of some requests without involving an off-process task runner like Celery. I use a custom implementation of this: https://django-simple-task.readthedocs.io/how-it-works.html It is way simpler when you don't need strong guaranties and checkpoints persistence.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: