Skip to main content

All Questions

0 votes
0 answers
75 views

Why is my async code no faster than synchronous?

So I had built a data pipeline which fetches reports from api endpoints, does some basic cleaning transformations and then concatenates the data into a an output dataframe. Originally I used ...
cluelessThrasher's user avatar
1 vote
0 answers
42 views

Python subprocess stoud handling while other code is running

I want to build a python script that start a subprocess and launches a CLI command(the cli command can take hours to run), so I want the main python to continue, however deploy a watcher, that keeps ...
crazywolf's user avatar
1 vote
1 answer
471 views

Writing Performant Python Bloomberg SAPI code to get streaming data from //blp/mkdata

All, I have been using blpapi with Python to query reference data (//blp/refdata) without issues and I've recently been using the streaming endpoint (//blp/mkdata); so my environment is set up (yes ...
ghbcode's user avatar
  • 79
0 votes
0 answers
98 views

Generating and playing audio whilst being connected to bluetooth device

I'm trying to write a script that plays pure tones (fixed frequency sine waves), whilst connected to a bluetooth device. I'm using bleak and asyncio to connect to the bluetooth sensor, and want the ...
oweydd's user avatar
  • 121
4 votes
0 answers
790 views

Python synchronous pyaudio data in asynchronous code

Here is my use-case: I am streaming some audio from a microphone using Pyaudio. I receive chunks of audio data every x milliseconds. I am opening a websockets connection if some condition is met. ...
HGLR's user avatar
  • 366
-3 votes
3 answers
605 views

python asynchronous map function that apply a function to every element of a list [closed]

I have a list of elements in python that I want to apply an API call to. The API involves web requests and I want to apply it synchronously. Since it is a third party API I can't really modify the ...
Julian Chu's user avatar
  • 2,070
0 votes
1 answer
539 views

How to monitor telnetlib3 connection for termination from host side continuously using asyncio

I am working on creating a telnet client in Python 3 using the telnetlib3 and asyncio modules. More specifically the telnet client is to connect with VLC Media Player's telnet interface. I have been ...
Harshit Bhardwaj's user avatar
2 votes
0 answers
969 views

Use cases for threading and asyncio in python

I've read quite a few articles on threading and asyncio modules in python and the major difference I can seem to draw (correct me if I'm wrong) is that in, threading: multiple threads can be used to ...
Biswadeep Sarkar's user avatar
1 vote
0 answers
81 views

How to make a python multi-threading scraper as a websocket server

I currently have a python multi-threading scraper that looks like following, how can I turn this into a websocket server so that it can push message once the scraper found some new data? Most ...
MachineLearner's user avatar
0 votes
1 answer
34 views

Asyncio getting different outputs

In the first example I am getting output I expect here to be, but I can't say same about second example. Technically, in both example I have 3 tasks (Just in second example, I am scheduling 2 coros ...
varuserx's user avatar
0 votes
1 answer
846 views

How can I run asyncio in different classes simultaneously

How can I run asyncio in different classes simultaneously? For example, I have first class, where I have method async def main(). I have second class, where method display_info, which must always ...
Bitcoin Earn's user avatar
0 votes
0 answers
146 views

Is there any way to get the result of an async method without blocking?

I'm providing some services through REST API that will occurs DB operation while performing a request. So i'm trying to create a class that performs queries using oracledb(cx_Oracle). A problem arises ...
Kyon's user avatar
  • 75
1 vote
0 answers
392 views

Execute function from loop only after last execution has finished

I have a loop (all this is being done in Python 3.10) that is running relatively fast compared to a function that needs to consume data from the loop. I don't want to slow down the data and am trying ...
kmdewey's user avatar
  • 61
0 votes
1 answer
177 views

Process async results in another thread - app architecture (python-3.7)

I have a programm that receives Data (Trades) from the Binance API. This data will be processed and visualized in a web-app with dash and plotly. In order to get best performance and the slightest ...
Benix6's user avatar
  • 1
1 vote
1 answer
254 views

Should Python process wait for a job forked using `run_in_executor`, although I did not wait for?

Assume we have the following script: def sync_sleep(x): print("sync_sleep going to sleep") time.sleep(x) print("sync_sleep awake") async def main(): loop = asyncio....
adnanmuttaleb's user avatar

15 30 50 per page