Skip to content

Commit

Permalink
Docs: Mentions raw OS-Thread outside an async runtime caused by Event…
Browse files Browse the repository at this point in the history
…Stream

This pull request is motivated by the discussion of the following
[issue](crossterm-rs#608)
  • Loading branch information
BoolPurist committed Sep 14, 2024
1 parent b056370 commit 5c81c41
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/event/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@ use crate::event::{
///
/// Check the [examples](https://github.com/crossterm-rs/crossterm/tree/master/examples) folder to see how to use
/// it (`event-stream-*`).
///
/// ## Caveats
///
/// On creating this future, a plain OS-thread is spawned. This thread is not scheduled
/// under the control of async runtime. This thread only shutdowns when this future is dropped !
///
/// This implementation will never yield an end for a stream aka a Ready(None).
///
/// User concerned about that overhead caused by the OS thread outside an async runtime,
/// are advised to implement their own stream implementation
/// in respect to their used async runtime.
#[derive(Debug)]
pub struct EventStream {
poll_internal_waker: Waker,
Expand Down

0 comments on commit 5c81c41

Please sign in to comment.