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: Mentions raw OS-Thread outside an async runtime caused by EventStream #928

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
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