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

substrate websocket getting blocked at subscription_handler #352

Closed
Jessie-1 opened this issue Aug 21, 2023 · 1 comment
Closed

substrate websocket getting blocked at subscription_handler #352

Jessie-1 opened this issue Aug 21, 2023 · 1 comment

Comments

@Jessie-1
Copy link

unable to subscribe more due to blocking.

@arjanz
Copy link
Member

arjanz commented Aug 21, 2023

The library is intended for a sync environment, but if you aim to subscribe to multiple storage keys at once you can have a look at the subscribe_storage() function, see docs:

https://polkascan.github.io/py-substrate-interface/usage/subscriptions/#subscribe-to-multiple-storage-keys

Otherwise you can resort to work with threads, be sure to use a separate instance of SubstrateInterface per thread because otherwise it wouldn't be threadsafe. See examples mentioned in:

#206 (comment)

#82 (comment)

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