7个版本 (稳定)
1.0.6 | 2024年1月22日 |
---|---|
0.1.0 | 2024年1月22日 |
#506 在 数据结构
7KB
一个简单的双向消息库
适用于跨两个线程进行通信等用例。
let (renderer_mailbox, game_mailbox) = Mailbox::new_entangled_pair();
renderer_mailbox.send(RenderLoopMessage::SyncWithGame);
if let Ok(RenderLoopMessage::SyncWithGame) = game_mailbox.poll() {
// ...
}
game_mailbox.send_and_wait(GameLoopMessage::SyncWithRender)?;
依赖
~300–760KB
~18K SLoC