-
Notifications
You must be signed in to change notification settings - Fork 93
add: yamux #268
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
Merged
add: yamux #268
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1031059
add short desc. for yamux
salmad3 4bab3f0
incorporate feedback, add backpressure info
salmad3 9ca4116
add note on yamux perference in libp2p
salmad3 cc7a8d2
incorporate pr feedback
salmad3 e3cd341
edit
salmad3 4bf2281
Apply suggestions from code review
salmad3 8abb607
Apply suggestions from code review
salmad3 643faf6
incorporate PR feedback + edits
salmad3 2536a9a
Apply suggestions from code review
salmad3 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,32 @@ | ||
--- | ||
title: "yamux" | ||
title: "Yamux" | ||
description: "yamux is a multiplexing protocol designed by Hashicorp." | ||
weight: 180 | ||
--- | ||
|
||
[yamux](https://github.com/hashicorp/yamux) is a multiplexing protocol designed by [Hashicorp](https://www.hashicorp.com/). | ||
yamux offers more sophisticated flow control than mplex, and can scale to thousands of multiplexed streams over a | ||
single connection. | ||
## What is Yamux? | ||
|
||
{{< alert icon="💡" context="note">}} | ||
This section is incomplete, and many of the articles are stubs. To help fill in | ||
the gaps, please see the issues linked in each article to add your input and | ||
help us prioritize the outstanding work. | ||
[Yamux](https://github.com/hashicorp/yamux) (Yet another Multiplexer) | ||
is a powerful stream multiplexer used in libp2p. It was | ||
initially developed by Hashicorp for Go, and is now implemented in Rust, JavaScript and other languages. | ||
enables multiple parallel streams on a single TCP connection. | ||
The design was inspired by SPDY (which later became the basis for HTTP/2), however | ||
it is not compatible with it. | ||
|
||
salmad3 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
One of the key features of Yamux is its support for flow control | ||
through backpressure. This mechanism helps to prevent data from | ||
being sent faster than it can be processed. It allows | ||
the receiver to specify an offset to which the sender can send | ||
data, which increases as the receiver processes the data. | ||
This helps prevent the sender from overwhelming the receiver, | ||
especially when the receiver has limited resources or needs to | ||
process complex data. | ||
|
||
{{< alert icon="" context="">}} | ||
**Yamux should be used over mplex in libp2p**, as mplex doesn't provide a mechanism to apply backpressure on the stream level. | ||
{{< /alert >}} | ||
|
||
### Resources | ||
|
||
- [Yamux overview and a list of features](https://github.com/hashicorp/yamux#yamux). | ||
- [Technical specification](https://github.com/hashicorp/yamux/blob/master/spec.md). |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.