#exit #signal #future #dropped #tetsy #coordinate #thread

tetsy-exit-future

Tetsy 退出信号未来的实现

显示软件包…

1 个不稳定版本

0.2.0 2021年2月24日

#25 in #tetsy

Download history 57/week @ 2024-03-31 19/week @ 2024-04-07 23/week @ 2024-04-14 28/week @ 2024-04-21 20/week @ 2024-04-28 19/week @ 2024-05-05 25/week @ 2024-05-12 21/week @ 2024-05-19 25/week @ 2024-05-26 25/week @ 2024-06-02 16/week @ 2024-06-09 21/week @ 2024-06-16 23/week @ 2024-06-23 5/week @ 2024-06-30 4/week @ 2024-07-07 19/week @ 2024-07-14

55 每月下载量
用于 23 个软件包(通过 tc-service

MIT 许可证

6KB
124

Tetsy Exit Future

文档


创建一个 Signal 和可复制的 Exit 未来,当 Signal 被触发或丢弃时触发。用于在多个事件循环线程之间协调退出。

let (signal, exit) = tetsy_exit_future::signal();

::std::thread::spawn(move || {
    // future resolves when signal fires
    exit.wait();
});

let _ = signal.fire(); // also would fire on drop.

依赖项

~1MB
~16K SLoC