refactor!: new implementation of subscriptions#122
Open
markspanbroek wants to merge 13 commits into
Open
Conversation
Contributor
|
Hey @markspanbroek! Thanks for the PR! I will try to have a look by the end of the week. |
Contributor
|
fyi, json-rpc has gained support for bidirectional comms and will be deprecating the existing message hook: status-im/nim-json-rpc#249 in an upcoming release. It's an open question whether the hook will be replaced, but likely not, since subscriptions can (and should) use the rpc router instead. Possibly there might be a hook for already-decoded messages or post-router lookup for messages that don't match the router, depending on demand. In the new setup, notifications are handled via the regular |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New implementation of subscriptions, that keeps a local view of all subscriptions instead of letting the JSON-RPC node handle the subscriptions.
Main advantages:
Additionally:
JsonRpcProvider.new()is replaced byJsonRpcProvider.connect(), to get an error when the connection failsResulttype, because subscription errors are now handled elsewhere