How can I stop reading from a tokio::io::lines stream?

前端 未结 2 1520
温柔的废话
温柔的废话 2020-12-21 10:45

I want to terminate reading from a tokio::io::lines stream. I merged it with a oneshot future and terminated it, but tokio::run was st

2条回答
  •  青春惊慌失措
    2020-12-21 11:12

    Thank you for your comment and correcting my sentences.

    I tried to stop this non-blocking Future and succeeded.

    let lines = Interval::new(Instant::now(), Duration::from_secs(1));
    

    My understating is that it would work for this case to wrap the blocking Future with tokio threadpool::blocking. I'll try it later.

    Thank you very much.

提交回复
热议问题