Skip to main content
New: Stack Overflow For Agents. The next generation of knowledge exchange. Learn more
Filter by
Sorted by
Tagged with
Best practices
0 votes
3 replies
95 views

For iterators, there is a clear protocol: once they are exhausted, they remain exhausted. It is not allowed to create an iterator whose __next__() raises StopIteration and, called once again, return a ...
glglgl's user avatar
-1 votes
1 answer
174 views

The Python documentation says: await is a Python keyword that’s commonly used in one of two different ways: await task await coroutine In a crucial way, the behavior of await depends on the type of ...
robertspierre's user avatar
1 vote
1 answer
219 views

I'm experimenting with Python asyncio and noticed that performance becomes worse when I create a very large number of very small async tasks. import asyncio import time async def tiny_task(): ...
Indrajith Bandara's user avatar
2 votes
0 answers
100 views

I migrated a Python service from sync grpcio calls wrapped in asyncio.to_thread(...) to native grpc.aio to reduce per-call latency, but after the switch I started seeing this error repeatedly in the ...
anish's user avatar
Advice
0 votes
7 replies
117 views

Currently working on a bot for Stoat (a Discord alternative) and was working with asyncio to hopefully have tasks done at a specific time each day or each week. For example, one would execute my ...
Benjamin Tsoumagas's user avatar
Advice
0 votes
2 replies
75 views

As the title implies, I am attempting to write a Django application to query noise meters remotely and display the real time information in a web page. Currently I am able to display live data in the ...
Voxie's user avatar
1 vote
2 answers
116 views

I trying to make ratelimiter for users in aiogram bot with middlware, now I created class for requests and class for ratelimiter, where reuqest are. My problem is what is better for performance and ...
madjetmax's user avatar
0 votes
2 answers
74 views

I am trying to model a system that uses asyncio and an event loop. I find that if I create an event loop, and start it with run forever it will not process new tasks, unless it has an unfinished ...
matt's user avatar
3 votes
1 answer
88 views

I often create Jupyter notebooks as plain .py files with # %% cell delimiters, like this: # %% import polars as pl import numpy as np # %% df = pl.read_parquet('my_cool.parquet') ... I can then run ...
Kerrick Staley's user avatar
Best practices
0 votes
0 replies
36 views

I am creating an async FastAPI service that trigger models via post requests. Each model has a different domain. It should support high throughput and low latency. What is the best way managing it? ...
Sharon Soussan's user avatar
Best practices
0 votes
0 replies
73 views

For asyncio workloads there's this convenience function that executes passed list of asyncio.Tasks until either a timeout is hit; first Task raises an exception; or all tasks succeed First two ...
laur's user avatar
0 votes
1 answer
74 views

I'm processing a large pandas DataFrame (500k rows) where each row requires an HTTP request. I switched from requests to aiohttp + asyncio expecting a significant speedup, but the async version runs ...
Джон Сноу's user avatar
2 votes
1 answer
115 views

Looking at the documentation for Event Loop, there is this example: import asyncio import concurrent.futures def blocking_io(): # File operations (such as logging) can block the # event loop: ...
squinterodlr's user avatar
Best practices
1 vote
3 replies
168 views

I’m working on a high-load async web application using FastAPI and I have a question about implementing login/registration logic with password hashing. Problem As we know, password hashing (e.g. with ...
F F's user avatar
1 vote
1 answer
81 views

I have a task where I have to fetch a lot of files from a database (I/O-bound) and process each of them (CPU-bound). I thought of using a producer-consumer pattern, where fetch workers (producers) ...
squinterodlr's user avatar

15 30 50 per page
1
2 3 4 5
529