You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having trouble with a binary protocol that does not use newlines as line separators. stdout seems to flush immediately only when there is a newline in the output.
I have included a snippet to reproduce this issue.
Flushing the underlying std stream works, but only when the async stream was flushed first.
stderr has the expected behaviour of flushing immediately correctly.
Version
0.2.0-alpha.4
Platform
Linux 4.19.0-5-amd64 #1 SMP Debian 4.19.37-5+deb10u2 (2019-08-08) x86_64 GNU/Linux
Subcrates
Description
use std::io::Write;use std::time::Duration;use tokio::prelude::*;use tokio::timer::delay;use tokio::io::{stdout};asyncfnworks() -> Result<(),Box<dyn std::error::Error>>{letmut output = stdout();
output.write_all(b"hello").await?;
output.flush().await?;
std::io::stdout().flush()?;Ok(())}asyncfnshould_work() -> Result<(),Box<dyn std::error::Error>>{letmut output = stdout();
output.write_all(b"hello").await?;
output.flush().await?;Ok(())}#[tokio::main]asyncfnmain() -> Result<(),Box<dyn std::error::Error>>{// Both calls should output "hello" without a newline immediately//works().await?;should_work().await?;let when = tokio::clock::now() + Duration::from_secs(5);delay(when).await;Ok(())}
The text was updated successfully, but these errors were encountered:
I'm having trouble with a binary protocol that does not use newlines as line separators. stdout seems to flush immediately only when there is a newline in the output.
I have included a snippet to reproduce this issue.
Flushing the underlying std stream works, but only when the async stream was flushed first.
stderr has the expected behaviour of flushing immediately correctly.
Version
0.2.0-alpha.4
Platform
Linux 4.19.0-5-amd64 #1 SMP Debian 4.19.37-5+deb10u2 (2019-08-08) x86_64 GNU/Linux
Subcrates
Description
The text was updated successfully, but these errors were encountered: