Skip to main content
1 vote
1 answer
40 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
66 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
  • 12.4k
3 votes
1 answer
71 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
22 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
59 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
  • 607
0 votes
1 answer
58 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
112 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
131 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
1 vote
1 answer
64 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
1 vote
1 answer
131 views

I've returned to a bot I created using the py-cord module several months ago, on a new device where I've reinstalled py-cord. The bot loaded fine when I was originally working on it, but now when I ...
Jasper Osbourne's user avatar
5 votes
1 answer
155 views

Using Python >=3.13.0 (tried 3.11.14, 3.12.10, 3.13.0, 3.13.8 and 3.14.0a5), when I try to run the terminal in async mode, it throws an IndentationError when I try to start an async with code block:...
Simon Pratt's user avatar
1 vote
1 answer
121 views

I have a sync call function that puts task in an asyncio.Queue so it can be processed by an async worker. Currently, I have something like this: import asyncio import os import sys queue = asyncio....
tobib's user avatar
  • 2,576
2 votes
1 answer
341 views

I see the errors when using this custom HttpHandler in my logger. Error deals with this handler because there are no error, when using another handlers. I see error only in K8S. Checked that POD ...
mascai's user avatar
  • 1,698
4 votes
1 answer
87 views

I want to create a window program that connects a Minecraft world to a local websocket. It works fine in the Thonny IDE and I can run everything smoothly, but when I try to start it via Bash, it ...
frost's user avatar
  • 51
0 votes
0 answers
53 views

I'm wondering what the best practice for a global httpx GlobalClient is in Python 3.14. generally it's best to have a single global event loop, but what if I need more parallelism or to not block with ...
Ivan Webber's user avatar

15 30 50 per page
1
2 3 4 5
529