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

Add Semaphore example for limiting the number of outgoing requests be… #6419

Merged
merged 6 commits into from
Mar 22, 2024

Conversation

czzrr
Copy link
Contributor

@czzrr czzrr commented Mar 20, 2024

Fixes #6412.

@github-actions github-actions bot added the R-loom-sync Run loom sync tests on this PR label Mar 20, 2024
@Darksonn Darksonn added T-docs Topic: documentation A-tokio Area: The main tokio crate M-sync Module: tokio/sync labels Mar 20, 2024
Copy link
Member

@maminrayej maminrayej left a comment

Choose a reason for hiding this comment

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

Some better spacing could make it more readable and make it more consistent with other examples.

  • A new line before ## Limit the number of outgoing ...
  • A new line after ## Limit the number of outgoing ...
  • A new line before This example uses ...
  • A new line before starting the code block
  • A new line before #[tokio::main]

Other than these, looks good to me.

@czzrr
Copy link
Contributor Author

czzrr commented Mar 21, 2024

Some better spacing could make it more readable and make it more consistent with other examples.

* A new line before `## Limit the number of outgoing ...`

* A new line after `## Limit the number of outgoing ...`

* A new line before `This example uses ...`

* A new line before starting the code block

* A new line before `#[tokio::main]`

Other than these, looks good to me.

I initially had this spacing, but rustfmt complained.
Turns out it was space after ///.
Fixed it.

tokio/src/sync/semaphore.rs Show resolved Hide resolved
tokio/src/sync/semaphore.rs Outdated Show resolved Hide resolved
@czzrr czzrr force-pushed the semaphore-example-sending-requests branch from 25ab3b6 to 2953f4e Compare March 21, 2024 21:59
@maminrayej maminrayej merged commit baad270 into tokio-rs:master Mar 22, 2024
75 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate M-sync Module: tokio/sync R-loom-sync Run loom sync tests on this PR T-docs Topic: documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Semaphore example on sending http requests
3 participants