7,813
questions
0
votes
0
answers
21
views
ib_insync RuntimeError: There is no current event loop in thread
I'm looking to use a pickled object of ib_insync.Stock in Dash App but receiving an error about lack of event loops.
How to reproduce: Create two files. 1. one to create a pickle of a ib_insync.Stock....
0
votes
1
answer
19
views
Python async coroutine and generator in one object
Is there any possibility to have two coroutines, one iterating over an async generator, the other one awaiting the Stop of the Iteration? like
coro1(gen):
async for _ in gen:
await asyncio....
0
votes
0
answers
27
views
Efficiently handling 10,000 HTTP requests in Python: AsyncIO, threading, or something else? [closed]
I’m working on a Python script that needs to update 10,000 records by making individual HTTP requests to a backend API. Each record has to be updated separately, and unfortunately, I don’t have the ...
0
votes
1
answer
45
views
How to process tasks as they complete when using TaskGroup?
I understand the arguments for using the newer TaskGroup in place of older mechanisms based on create_task().
However, TaskGroup exits after all tasks are done. What if you want to start processing ...
0
votes
0
answers
19
views
Race Condition in Confluent Kafka Consumer with Asyncio and ThreadPoolExecutor in Python
I'm working on a Python application where I need to consume messages from a Kafka topic, process them by making an async API request, and produce a response to an outbound Kafka topic. Since the Kafka ...
1
vote
0
answers
15
views
Asyncio.ws_connect not receiving a connection closure message
async def _connect_session(self):
websocket_url, headers, cookies = self._get_connect_data()
try:
async with aiohttp.ClientSession(cookies=cookies) as session:
logger.debug(...
0
votes
1
answer
28
views
How to organize data transfer from one program to another?
I have a telegram bot and a direct program interacting api twitter, they are on the same server and in the same directory. I need that when the user passes data to the handler they go to the other ...
0
votes
1
answer
34
views
Why is await queue.get() Blocking and Causing My Async Consumers to Hang?
I’m having trouble with an asynchronous queue. Specifically, the await queue.get() seems to block the rest of my application, causing it to hang.
I came across a similar issue discussed here: Why is ...
0
votes
0
answers
21
views
sqlalchemy with asyncio inserting multiple columns not working
I'm trying to populate a postgresql table with data using sqlalchemy and its support for asyncio. I based my code on the example from sqlalchemy's documentation (sqlalchemy asyncio synopsis), which ...
0
votes
0
answers
31
views
How can I run/start an async periodic task in the background in FastAPI [duplicate]
Assuming to have a list of Callable async tasks and I wish to run them in a background with a periodic timing. How can I design this with FastAPI?
In my toy example I tried the BackgroundTasks but as ...
0
votes
1
answer
38
views
asyncio.timeout for async generator does not work
Why does asyncio.timeout not work when wrapping async generator like in example below?
async def generate_many_numbers():
for i in range(1000000000):
yield i
async def main2():
async ...
-1
votes
0
answers
35
views
Efficient asynchronous method to retrieve all videos from a YouTube channel
I need to retrieve all videos from a YouTube channel asynchronously. Libraries like yt-dlp and pytube are no longer maintained. I also tried using scrapetube, but it's too slow (I attempted to call ...
0
votes
1
answer
33
views
How to use asyncio gather with sqlalchemy session in FastAPI and the workaround
I am trying to make an asynchronous call using asyncio gather to call multiple database query. I am getting error
sqlalchemy.exc.IllegalStateChangeError: Method 'close()' can't be called here; method '...
1
vote
0
answers
19
views
Running async NATS functions synchronously
I want to wrap a python module so it can be used either directly via import or via RPC through NATS, as transparently as possible. The problem is that when using NATS, all functions are async and as ...
-2
votes
0
answers
34
views
I wrote a Python bot for telegram that should copy messages from different channels using filters [closed]
I wrote a Python bot for telegram that should copy messages from different channels using filters, if a symbol, word or phrase is present in the message, the message should be forwarded, with one ...