Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changing subscriptions of a running #202

Open
trades2much opened this issue Jan 15, 2025 · 1 comment
Open

changing subscriptions of a running #202

trades2much opened this issue Jan 15, 2025 · 1 comment

Comments

@trades2much
Copy link

In this example:

async with DXLinkStreamer(session) as streamer:
    await streamer.subscribe_candle(subs_list, interval, start_time)
    async for c in streamer.listen(Candle):
        print(c)

Is it possible to add/remove subscriptions on the (existing) DXLinkStreamer after starting to listen? Actually, while listening. In a simple case, subscribing to another symbol's candles from another Jupyter notebook cell.

Thank you!

@Graeme22
Copy link
Contributor

Yes, it's possible. This isn't really a SDK question though--I'd recommend you read up on asyncio. The docs have a relatively simple example of how to do multiple things by creating several tasks, but you should be able to find more complex examples online.
Also, I don't think you can run two Jupyter cells simultaneously without adding a plugin/library for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants