Skip to content

Commit

Permalink
doc: clarify limits on return values of AsyncWrite::poll_write (#3820)
Browse files Browse the repository at this point in the history
  • Loading branch information
edward-shen committed May 31, 2021
1 parent 8f6d8b2 commit bdd6765
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tokio/src/io/async_write.rs
Expand Up @@ -45,7 +45,11 @@ use std::task::{Context, Poll};
pub trait AsyncWrite {
/// Attempt to write bytes from `buf` into the object.
///
/// On success, returns `Poll::Ready(Ok(num_bytes_written))`.
/// On success, returns `Poll::Ready(Ok(num_bytes_written))`. If successful,
/// then it must be guaranteed that `n <= buf.len()`. A return value of `0`
/// typically means that the underlying object is no longer able to accept
/// bytes and will likely not be able to in the future as well, or that the
/// buffer provided is empty.
///
/// If the object is not ready for writing, the method returns
/// `Poll::Pending` and arranges for the current task (via
Expand Down

2 comments on commit bdd6765

@github-actions
Copy link

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'sync_mpsc'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: bdd6765 Previous: 8f6d8b2 Ratio
send_large 55422 ns/iter (± 6653) 23900 ns/iter (± 96) 2.32

This comment was automatically generated by workflow using github-action-benchmark.

CC: @tokio-rs/maintainers

@github-actions
Copy link

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'sync_mpsc'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: bdd6765 Previous: 8f6d8b2 Ratio
send_large 62014 ns/iter (± 4489) 23900 ns/iter (± 96) 2.59

This comment was automatically generated by workflow using github-action-benchmark.

CC: @tokio-rs/maintainers

Please sign in to comment.