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

feat: disable namespace replication #285

Merged
merged 4 commits into from
Sep 27, 2023
Merged

feat: disable namespace replication #285

merged 4 commits into from
Sep 27, 2023

Conversation

gmaclennan
Copy link
Member

@gmaclennan gmaclennan commented Sep 27, 2023

This enables the sync API for disabling sync by adding an "unreplicate"
function that removes a core from the replication stream, without
closing the stream. Unreplicating a core from a replication with a peer
is currently the only way to stop a peer from receiving data from you -
Hypercore has no API yet for blocking uploads to peers when they request
data.

TODO:

  • Add tests for CoreManager & ReplicationStateMachine

This enables the sync API for disabling sync by adding an "unreplicate"
function that removes a core from the replication stream, without
closing the stream. Unreplicating a core from a replication with a peer
is currently the only way to stop a peer from receiving data from you -
Hypercore has no API yet for blocking uploads to peers when they request
data.
@gmaclennan gmaclennan self-assigned this Sep 27, 2023
@gmaclennan gmaclennan marked this pull request as ready for review September 27, 2023 15:37
@gmaclennan gmaclennan requested a review from achou11 September 27, 2023 15:52
)
if (!peerToUnreplicate) return
peerToUnreplicate.channel.close()
return
Copy link
Member

Choose a reason for hiding this comment

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

remove this?

Suggested change
return

@gmaclennan gmaclennan merged commit c9387bd into main Sep 27, 2023
@gmaclennan gmaclennan deleted the feat/unreplicate branch October 26, 2023 02:02
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