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

Fix filter polling leak #1474

Merged
merged 7 commits into from
May 22, 2017
Merged

Fix filter polling leak #1474

merged 7 commits into from
May 22, 2017

Conversation

danfinlay
Copy link
Contributor

By injecting a FilterSubprovider into the inpage-provider, I'm able to keep filter polling logic in-page, while keeping caching logic in our background process, so that subscriptions are deallocated when pages are closed.

Fixes #1458

Required refactoring the StreamingSubprovider to be a composable ProviderEngine instance, so that the FilterSubprovider could be added to it.

For this reason, there was a small API break in web3-stream-provider that needs to be merged & deployed before these tests can be rebuilt & will pass:
MetaMask/web3-stream-provider#1

const filterSubprovider = new FilterSubprovider()
engine.addProvider(filterSubprovider)

const stream = self.stream = new StreamSubprovider()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you rename to streamProvider or something less generic

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like RemoteStreamSubprovider? I'm not sure what you mean less generic. Isn't descriptive good here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i mean instead of stream

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh ok, done.

@danfinlay
Copy link
Contributor Author

Good changes! 👍

@kumavis kumavis merged commit 8520fe5 into master May 22, 2017
@kumavis kumavis deleted the i1458-StreamingSubprovider branch May 22, 2017 23:19
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

Successfully merging this pull request may close these issues.

2 participants