Quantcast
Channel: Active questions tagged datafeed - Stack Overflow
Viewing all articles
Browse latest Browse all 51

pipe output from repeated function calls to python generator

$
0
0

I can't think of a better title to describe the problem but here it is.

I have a function that is called at random unscheduled intervals by a module which receives data.

There's another module that utilizes websockets and takes in data in the following method

def ws_handler(ws):    for data in data_feed():        ws.send(json.dumps(data)) 

and the data_feed periodically yields an output.

I can't figure out a way to replace the dummy data_feed() with the feed coming from the first module without hosting a local server with additional websockets or using multithreading. I feel like threading shouldn't be necessary as the process is linear and attempting with asyncio pipeline both increases delay and i cant figure out a way to execute async task immediately.


Viewing all articles
Browse latest Browse all 51

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>