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

Adjust Kad to be a one-channel-one-shot protocol #830

Closed
tomaka opened this issue Jan 8, 2019 · 2 comments
Closed

Adjust Kad to be a one-channel-one-shot protocol #830

tomaka opened this issue Jan 8, 2019 · 2 comments

Comments

@tomaka
Copy link
Member

tomaka commented Jan 8, 2019

No description provided.

@tomaka
Copy link
Member Author

tomaka commented Jan 22, 2019

Contrary to #829 and #828, this one is more difficult as we have to answer requests by sending a response in the same substream as the request.

There are two possibilities:

  • When the ProtocolsHandler receives a request, it sends through an event an object containing the subtream to the NetworkBehaviour. The NetworkBehaviour then runs the future that sends back the answer.
  • When the ProtocolsHandler receives a request, it sends through an event some sort of identifier to the NetworkBehaviour, which must then be sent back to the ProtocolsHandler through another event.

The current approach is the second one, and I would be more in favour of this second approach, as it removes the possibility of having to wait for a Mutex when writing on a substream, and avoids waking up the "main task" when we are ready to send data to a specific node.

@thomaseizinger
Copy link
Contributor

Closed in favor of #3130.

@thomaseizinger thomaseizinger closed this as not planned Won't fix, can't repro, duplicate, stale Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants