Skip to content

Expose addRemovePeers method on network classes #17814

Open
@abies

Description

Main way of communicating with the network classes will be through addRemovePeers(Collection added, Collection removed)
We need to handle it in thread-safe way, starting connections for new ones and tearing down connections for removed ones.

  • this method has to be thread safe against whatever is happening with connections in background (in particular, it should be possible to remove connection which is just in the middle of being set up/reconnected)
  • assumption is that this method won't be called concurrently; should be protected against that, report errors and do a forceful synchronization
  • assumption is that caller will call it with proper parameters (peer will be removed only if was added earlier, peer won't be added twice in the row)
  • current guarantees need to be preserved (especially regarding special pause/resume logic with regards to Reconnect logic)

Out of scope of this task (has to be implemented by callers):

  • logic for implementing diffs between Rosters to produce added/removed lists of peers
  • possible logic for merging request between multiple rounds and delaying removals till given roster becomes stale

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

PlatformTickets pertaining to the platform

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions