Make great things

What I cannot create, I do not understand.

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
  • red (async) function, blue (sync) function
  • #[tokio::main(flavor = "current_thread")]tokio 只用单线程运行时.
  • Future::pollawait 时第一次运行, 然后需要调用 wake() 方法告诉运行时再次调用.
  • poll 中调用其他 Future 对象的 poll 方法.
    1. 将其 Box::pin
    2. futures::FutureExt 扩展的 poll_unpin 方法
    3. Pin::new(T) where T: Unpin
  • Pin<T> trait

https://fasterthanli.me/articles/pin-and-suffering

posted on 2021-03-30 09:34  wbin91  阅读(73)  评论(0编辑  收藏  举报