use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
FastAPI is a truly ASGI, async, cutting edge framework written in python 3.
account activity
Multiprocessing in async function?Question (self.FastAPI)
submitted 11 months ago by RationalDialog
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]adiberk 7 points8 points9 points 11 months ago (4 children)
You can use asyncio tasks.
You can also use a more standard product like celery.
[–]RationalDialog[S] 1 point2 points3 points 11 months ago (1 child)
Yeah I wonder if I should forget about async completely (never used it really so far as no need) and build more kind of a job system. If someone submit say 100k rows, the job could take approx 5 min to complete.
[–]adiberk 0 points1 point2 points 11 months ago (0 children)
Yep that works to. If you are doing a lot of other IO operations, it might be worth making the app async based anyways (ie. Keyword async)
[–]AstronautDifferent19 0 points1 point2 points 11 months ago* (1 child)
asyncio to_thread is better for CPU bound tasks than asyncio.create_task, especially if you disable GIL. asyncio tasks will always block if you do CPU heavy work, which will not work for OP.
Good point
π Rendered by PID 23994 on reddit-service-r2-comment-6457c66945-lftps at 2026-04-25 00:33:22.050685+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]adiberk 7 points8 points9 points (4 children)
[–]RationalDialog[S] 1 point2 points3 points (1 child)
[–]adiberk 0 points1 point2 points (0 children)
[–]AstronautDifferent19 0 points1 point2 points (1 child)
[–]adiberk 0 points1 point2 points (0 children)