Crates.io | messaging |
lib.rs | messaging |
version | 1.0.6 |
source | src |
created_at | 2024-01-22 20:30:24.249991 |
updated_at | 2024-01-22 21:13:33.085439 |
description | A simple two-way messaging crate |
homepage | |
repository | https://github.com/GTLugo/messaging |
max_upload_size | |
id | 1109151 |
size | 17,579 |
Good for use cases such as communication across two threads.
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)?;