Open cardosofede opened 5 months ago
Great question, I'm curious for the reply by experts, been working on something similar.
Can you give me an MRE? (GitHub repository with minimal setup would be great.)
I'll reopen if you reply.
Sorry I just saw the message, will create one tomorrow
@Kludex hey, I have an example here: https://github.com/hummingbot/backend-api/blob/feat/add_market_data/routers/manage_market_data.py
I'm thinking about creating an endpoint to start a candles and stop the candles from a collection and if you ask for the realtime candles instead of creating and initializing the object will be just using the active candles.
As a reference, this is the class that we use in Hummingbot to keep the most updated length required of candles that are running: https://github.com/hummingbot/hummingbot/blob/master/hummingbot/data_feed/market_data_provider.py
Hey, First of all thanks for this initiative, it's great! I have a question regarding the lifespan to manage objects. Let's say that I would like to provide realtime data, and I have an object that subscribes via ws and keeps certain data updated, so I can expose a route to provide this data aggregated. Should I create the object with the lifespan approach? Or which is your recommendation?