All Questions
96 questions
0
votes
1
answer
21
views
Python asyncio Lock.release(): object NoneType can't be used in 'await' expression
Code & Context
I'm building a multithreaded program to automate API calls, to retrieve all the information I need based off of a list of unique IDs.
To do this, I ended up creating my own Lock ...
0
votes
2
answers
289
views
Is it safe to create asyncio event loop in one thread and run it in another thread while having ability to cancel it from outside the thread (python3)
I want to know if it's safe to create an asyncio event loop in one thread and run the loop in another while having the ability to cancel it from outside the thread in which the event loop is running. ...
0
votes
0
answers
60
views
How to parallelize long-running IO operations in a multi-threaded Python application with asyncio?
I am building a Python application that uses an event loop (via the asyncio library) to listen for tick data from a cryptocurrency exchange via a WebSocket. The tick data comes for various symbols, ...
0
votes
1
answer
70
views
Is there an issue if two asyncio tasks, one reads and one writes, uses one single websocket at the same time?
I have the following simplified code:
import asyncio
import websockets
async def read_from_ws(websocket):
async for message in websocket:
print(f"Received message: {message}")
...
0
votes
0
answers
423
views
is there a way to dynamically add tasks to asyncio tasks or to AnyIO TaskGroup?
I am new to asyncio, threading and Message Brokers and I am struggling with non-blocking execution. I will explain a bit more about the solution I wrote and appreciate any suggestion on how to improve ...
0
votes
0
answers
103
views
Python AsyncIO, multithreading and multiprocessing performance
I'm actually trying to speed-up a piece of code that is writing thousands of small files.
My first idea was to use asyncIO, as writing file is a blocking I/O.
I also thought it could be interesting to ...
0
votes
0
answers
123
views
Should I use Multithreading or Async IO to speed up a network bound task?
I have a python function that SSHs into a device, runs some commands and uses the data to make HTTP calls. I want to make migrate_devices run in parallel when processing the devices.
Existing function,...
0
votes
0
answers
114
views
Python object has no object has no attribute 'asyncio'?
I am trying to connect two nodes via WebSocket API but I have trouble letting the kern object do the API call. And I am also trying to let the node to node communication work in another thread. Or ...
-1
votes
1
answer
141
views
How do I create a multithreaded async server application with Python [closed]
for clarity i am using python3.10.9
The program i am trying to make consists of a ThreadPool and some type of async runtime environment. If a connection comes in on a listening socket, the async ...
0
votes
1
answer
38
views
Best way to keep creating threads on variable list argument
I have an event that I am listening to every minute that returns a list ; it could be empty, 1 element, or more. And with those elements in that list, I'd like to run a function that would monitor an ...
2
votes
1
answer
418
views
Not getting any response from the server in case of some requests with asyncio and aiohttp
I am trying to send asynchronous requests in python using asyncio and aiohttp. While I am trying to make multiple requests all at once and sending them all at once to the server I am getting back ...
0
votes
0
answers
125
views
What is the best way to wrap Thread/Process in magic method __await__ to create awaitable class?
I would like to create "awaitable" class instances. It will be useful when I have to use some db connectors which do not have asyncio wrappers. Also it is just interesting for me to better ...
0
votes
0
answers
667
views
Run asyncio loop in a separate thread
I have a component of an application that needs to run an IOLoop in a separate thread. I try to achieve that by creating an new IOLOOP in a background Thread and starting the loop. My original use ...
0
votes
0
answers
113
views
Fastest way to download a long list of zipfiles in python
I'm working on a project that requires downloading a lot of files (about 13,000) from a list of links in python. The downloaded zipped files will then be extracted and the contents of the .cpp file in ...
0
votes
1
answer
381
views
Run async task in class that extends Threading - python
I've created a python class that extends threading and uses a library that runs asyncio tasks.
import threading
from app.food import recipes
class Mixer(threading.Thread):
def __init__(self):
...