We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
If two callers subscribe, for instance, using onAccountChange() for the exact same address, we set up two subscriptions.
onAccountChange()
Implement subscription pooling.
Create a map of people who care about a given subscription:
const accountChangeListeners: Map< string, // Pubkey AccountChangeCallback[] > = new Map();
When that list of callbacks goes from zero to one, set up the subscription. When it falls from 1 to zero, unsubscribe.
When a subscription publishes a payload, broadcast it to all of the callbacks.
The text was updated successfully, but these errors were encountered:
I second this - was just looking at this issue and handling it locally at the moment! Subscription pooling would be great.
Sorry, something went wrong.
Nice! Any feedback on our implementation @LeFinc? #24473.
steveluscher
No branches or pull requests
Problem
If two callers subscribe, for instance, using
onAccountChange()
for the exact same address, we set up two subscriptions.Proposed Solution
Implement subscription pooling.
Create a map of people who care about a given subscription:
When that list of callbacks goes from zero to one, set up the subscription. When it falls from 1 to zero, unsubscribe.
When a subscription publishes a payload, broadcast it to all of the callbacks.
The text was updated successfully, but these errors were encountered: