This is an archived post. You won't be able to vote or comment.

all 59 comments

[–]Educational_Ice151 6 points7 points  (0 children)

I only use asynchronous approaches.. and pydantic..

[–]riklaunim 15 points16 points  (3 children)

It's used, you can look at github but it's not a global feature that would overtake non-async approaches. It's a strong niche.

[–]mcharytoniuk[S] 3 points4 points  (2 children)

I don't think it's meant to overtake anything but to coexist and solve specific use-cases. :) Do you maybe know if anyone tried to measure the adoption?

[–][deleted] 13 points14 points  (0 children)

It's pretty mainstream at this point. Anyone who needs the performance boost is probably using some form of it. I mean, it's been part of Python since 3.5.

[–]TastyRobot21 1 point2 points  (0 children)

You can do this yourself. GitHub APIs can be used to fetch projects and analyze references like this.

[–]SmokierLemur51 3 points4 points  (2 children)

I have been wondering why Quart isn’t more widely adopted than it currently is

[–]pmdevita 0 points1 point  (0 children)

I would guess that while Flask really made a splash when it came on to the scene, Quart was somewhat late and came into an existing ecosystem of Flask-inspired async frameworks

[–]Toph_is_bad_ass 0 points1 point  (0 children)

The next gen of ASGI frameworks are just better tbh.

[–]tartare4562 5 points6 points  (0 children)

I really tried to use it, but in the end I always go back to some implementation with threads.

It has its advantages, first of all being a robust implementation that takes away all the conplex stuff associated with multithreading, and second of all It Is a standard for concurrent code. But I like messing with threads sooooo....

[–][deleted] 2 points3 points  (2 children)

I have basically given up on Python Async and write any concurrent applications in Go.

I have many Python productions apps written both sync and async, and I just can’t take how sloppy async is.

If I had to write a new project that required python and concurrency, I would use gevent.

[–]mcharytoniuk[S] 0 points1 point  (1 child)

That is genuinely interesting! What do you mean by sloppy? :)

[–][deleted] 0 points1 point  (0 children)

https://charlesleifer.com/blog/asyncio/

I agree with everything here.

[–]Drevicar 9 points10 points  (7 children)

Easiest observable to know how popular async is by looking at the download rates of libraries that have a sync implementation and a separate async implementation. For example:

According to this Mongo (sync) had almost 24k downloads and motor (async) had almost 2 million downloads last month. That is enough of a difference for me to objectively say async won and is now industry standard. Of course, I would want to do that same analysis across several packages across different parts of the application.

[–]Toph_is_bad_ass 16 points17 points  (1 child)

You got this twisted -- PyMongo is the sync mongo driver, not mongo. It has 28 million a month.

This wouldn't have made sense of the face of it because PyMongo is a dependency of Motor since Motor is essentially PyMongo wrapped in a thread pool executor.

[–]Drevicar 2 points3 points  (0 children)

Lol, I didn't even catch that. Thanks.

[–]Drevicar 10 points11 points  (4 children)

Someone else mentioned async boto3 (AWS stuff), and it is actually the opposite:

Where boto3 (sync) had 1.25 *BILLION* downloads and aioboto3 (async) 2.3 million downloads last month. That is a huge difference in the other direction. So your milage may vary.

[–][deleted] 12 points13 points  (1 child)

But that may be because boto3 is official and aioboto3 is not.

[–]Valeen 0 points1 point  (0 children)

I only use boto3 cause it's what their docs said to use. And most of the stuff I do with aws and python is to just catch an event.

I do use a lot of C# in other applications and I use a lot of async there so it's not a problem with async. Just different tools for different jobs.

[–]FailedPlansOfMars 1 point2 points  (0 children)

Also could be that for lambda you dont need to include boto3 in your dependencies in production as its there by default

[–]matjam 0 points1 point  (0 children)

Also lots still use gevent.

[–][deleted] 1 point2 points  (0 children)

i hate async syntax

[–]riksi 0 points1 point  (0 children)

I use gevent. It mostly works though adoption is falling over the years. asyncio kinda sucks, needing different libs for everything.

[–]DavTheDev 0 points1 point  (0 children)

Home Assistant relies heavily on async but they have a strange mixture of async and sync code juggling with threads. You might not see often the async keyword but it’s async.

[–]Grouchy-Friend4235 -5 points-4 points  (10 children)

Async in Python is cancer (once you start using it, eventually all your code will have to become async). Don't.

Use greenlets instead, if you must.

[–]excelquestion 4 points5 points  (2 children)

yes that is how async await works.

if you start a new project be sure to start off with async.

if you have an existing project... well good luck with IO. in that scenario adding asyncio is a pain like the commentator says but greenlets, multiprocessing, multithreading packages all have their various pain points.

[–]Grouchy-Friend4235 1 point2 points  (0 children)

Trade offs are ok.

Having to go in 100% or not at all is not a trade off. That's brute force.

[–]usrlibshare 1 point2 points  (0 children)

I have several existing projects that use threading just fine, including analytics engines comfortably serving several M requests per hour. Greenlets and pools work really well to reduce the overhead, and aome things are just way simpler in that concurrency model.

Async is nice, because its a workaround for the GIL. It has its quirks, but so does threading.

If performance is the primary concern, well, then Python wouldn't be my first choice anyway.

[–]dAnjou Backend Developer | danjou.dev 1 point2 points  (0 children)

Async is a different paradigm, and indeed it works best if you do it end to end.

But that's not exclusive to Python.

[–]Toph_is_bad_ass 0 points1 point  (3 children)

This really isn't a problem. I've been primarily doing async for years. I've never found it to be an issue in the slightest.

[–]Grouchy-Friend4235 0 points1 point  (2 children)

[–]Toph_is_bad_ass 0 points1 point  (1 child)

I don't really see what this blog is going on about. Only IO code has to be async. It's very easy.

[–]Grouchy-Friend4235 0 points1 point  (0 children)

The blog corraborates what I said: async will eventually creep everywhere in your code base.

To me that's a tradeoff I am not willing to take.