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

docs: stream operator throttle typo #1348

Merged
merged 4 commits into from
May 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ See also @ref:[Buffers and working with rate](../../stream-rate.md) for related
## Example

Imagine the server end of a streaming platform. When a client connects and request a video content, the server
should return the content. Instead of serving a complete video as fast as bandwith allows, `throttle` can be used
should return the content. Instead of serving a complete video as fast as bandwidth allows, `throttle` can be used
to limit the network usage to 24 frames per second (let's imagine this streaming platform stores frames, not bytes).

Scala
Expand All @@ -41,8 +41,8 @@ Scala
Java
: @@snip [Throttle.java](/docs/src/test/java/jdocs/stream/operators/sourceorflow/Throttle.java) { #throttle-with-burst }

The extra argument to set the `ThrottleMode` to `shaping` tells `throttle` to make pauses to avoid exceeding
the maximum rate. Alternatively we could set the throttling mode to cause a stream failure when upstream is faster
The extra argument to set the `ThrottleMode` to `shaping` tells throttle to make pauses to avoid exceeding
the maximum rate. Alternatively we could set the `ThrottleMode` to `enforcing` to cause a stream failure when upstream is faster
than the throttle rate.

The examples above don't cover all the parameters supported by `throttle` (e.g. `cost`-based throttling). See the
Expand Down