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

Watch downloads #5

Merged
merged 2 commits into from
Sep 16, 2020
Merged

Conversation

Frando
Copy link
Contributor

@Frando Frando commented Aug 10, 2020

This PR allows to watch downloads. It adds watchDownloads and unwatchDownloads methods to the hypercore service. If watching downloads, onDownload is called towards the client for each downloaded block. Only the seq is transferred, not the full block. Download events are disabled by default, to skip the overhead for clients that don't need them.

This is a part of #2 and a step towards running kappa-style apps on top of hyperspace, especially for indexing sparsely synced hypercores in live mode.

Instead of adding watchDownloads and unwatchDownloads methods I was also considering of adding a single options method with a OptionsRequest { bool watchDownloads = 1 }. When/if other session options came along that could make this more straightforward instead of adding getters and setters for each option - not sure though.

@Frando
Copy link
Contributor Author

Frando commented Aug 11, 2020

CI fails because this depends on the two PR linked through the references. Not sure if there's a nice way to run CI for such interdependent PRs.

@mafintosh mafintosh merged commit 6023f33 into hypercore-protocol:master Sep 16, 2020
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