Questions tagged [python-asyncio]
This tag is to be used for the asyncio Python package which provides mechanisms for writing single-threaded concurrent code. The asyncio package provides asynchronous I/O, event loop, coroutines and tasks beginning with Python 3.4.
python-asyncio
7,734
questions
0
votes
0
answers
36
views
Asynchronous CPU-Bounded task PYTHON
I have a class "FXvolatility" which can interpolate some value based on two inputs (float, datetime) via this following method:
async def interpolate_volatility_async(self, udl:str, expiry:...
0
votes
0
answers
39
views
How to create a parallel program that reads different data
I'm trying to create a process that listens to three COM ports and process the data in parallel. The problem is that I have a machine that sends an ID and proceeds to do a test in one of the COM ports,...
0
votes
1
answer
26
views
Walking all OIDs from base OID using walkCmd using pysnmp-lextudio
I'm new to pysnmp(-lextudio) and have zero experience with asyncio as well. I'm trying to walk all OIDs from a base OID (ciscoSmartLicMIB - .1.3.6.1.4.1.9.9.831). Apparently the old way to do this was ...
0
votes
1
answer
30
views
Apply async batching to Dataframe.apply()?
I have already checked out this url:
Can I execute a function in "apply" to pandas dataframe asynchronously?(Can I execute a function in "apply" to pandas dataframe asynchronously?)...
0
votes
1
answer
58
views
how to run data processing tasks asynchronously in fast api? [duplicate]
I have a route in my fast api application, (sample code below). my root route calls an async function called read_root. in this function , i want to query database , gets some result and upload it to ...
0
votes
0
answers
40
views
GUI unable to send messages through Manager().Queue() to the processes
Please guide me in the right direction if this is already answered. I have a GUI script that has several buttons and when I click the start button, it needs to send a message to a process which is ...
0
votes
0
answers
70
views
Understanding sync_to_async method in Django?
I have never worked with asyncio and/or asynchronous methods with django and am having a little difficulty understanding.
I am trying to convert a synchronous utility function (create_email_record) ...
0
votes
0
answers
26
views
qasync with IPython hangs on run_until_complete
I would like to have an asynchronous gui with PyQt5. The synchronous version of what I want would look like this:
from PyQt5.QtWidgets import QPushButton, QMainWindow
import asyncio
import time
import ...
1
vote
1
answer
21
views
When using AsyncClients in Google Cloud Python SDK, got future attached to a different loop
I'm quite new to using asyncio in Python. Originally I have a sync function speak:
from google.cloud import texttospeech
client = texttospeech.TextToSpeechClient()
def speak(*args):
# omitted
...
0
votes
1
answer
43
views
Best approach to object creation in the background without using a task queue system?
I have been thinking of the best approach to a record creation in the background without using django signals, or celery, etc.
I do not want to use signals due to the fact that the sender Model would ...
1
vote
0
answers
37
views
Why can't I call Run from asyncio twice in the same function?
I am using Celery to process background tasks in my application. Sometimes, I need to process asynchronous functions within those tasks, for which I use asyncio. And in this case, I also need to ...
0
votes
1
answer
18
views
Archtecture/Design pattern for communication between asyncio and non-asyncio context
I am writing a TCP-based client which do both req/rep pattern communication and push/pull pattern communication. I tried to employ asyncio and its transport/protocol structure to handle the low-level ...
2
votes
3
answers
61
views
asyncio how to chain coroutines
I have the following test code, where I am trying to chain together different coroutines.
The idea is that I want to have one coroutine that downloads data, and as soon as data is downloaded I want to ...
1
vote
1
answer
36
views
aiohttp showing 403 Forbidden but requests.get giving 200 OK response
I'm using aiohttp to asynchronously scrap some price from an url.
Before, I used requests.get to synchronously do the same.
I am able successfully able to scrap using requests.get but the same URL ...
1
vote
0
answers
39
views
Print API objects/ Payload received via POST/GET on response with asyncio [closed]
I want to print out every API object I receive on an event or the whole payload respectively (POST/GET).
The code works and looks like below
Code:
async def main():
async with client_session() as ...