Skip to main content
Filter by
Sorted by
Tagged with
2 votes
1 answer
96 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
111 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
58 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
79 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
131 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
95 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,566
2 votes
1 answer
335 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,692
4 votes
1 answer
83 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
47 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
0 votes
2 answers
113 views

I’m developing a Python library that uses asyncio. When run as a regular Python script, everything works as expected. However, the same library is also used inside Jupyter notebooks, where it fails ...
daan de wit's user avatar
1 vote
1 answer
86 views

I am trying to understand task cancellation semantics in asyncio, specifically when asyncio.gather() is used and one of the tasks indirectly blocks the event loop. import asyncio import time async ...
Utkarsh Nigam's user avatar
0 votes
1 answer
156 views

I'm trying to use the Google ADK LLM agent (gemini-2.5-flash-lite) in a Flask project to check tests and review test content. I'm using InMemoryRunner and InMemorySessionService to run my agents. Here'...
Don Pietro Dado's user avatar
-3 votes
2 answers
171 views

I clearly have a fundamental misunderstanding of how async works. In Python 3.14, this snipped: import asyncio import asyncpg def adapted_async(): conn = asyncio.run(asyncpg.connect(...
Christophe's user avatar
  • 2,114
1 vote
2 answers
68 views

I want to add a decorator on a FastAPI route like this: /admin/verification.py from functools import wraps import json def admin_required(admin_function): @wraps(admin_function) def ...
gtj520's user avatar
  • 383
2 votes
2 answers
196 views

I’m building a long-running background service in Python using asyncio, and I’m facing a memory usage issue that keeps growing over time. The service schedules multiple async tasks every few seconds, ...
Online Water Bottle's user avatar

15 30 50 per page
1
2 3 4 5
529