(少なくともカレントスレッドが)ブロックしない Future を作ろうと思ったら oneshot::spawn(poll_fn(|| { blocking(|| { // ブロックするコード }) ), &mut exec) と書くと良いのか(execはブロックするFutureを実行するためのExecutor)
-
Show this thread
let mut value_opt = Some(value); oneshot::spawn(poll_fn(move || { blocking(|| { let value = value_opt.take().unwrap(); ... ret }) }, &mut exec)
11:47 AM - 16 Jun 2018
0 replies
0 retweets
1 like
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.