Skip to content

Commit

Permalink
feat: clear_mailbox
Browse files Browse the repository at this point in the history
  • Loading branch information
vmenge committed Jan 10, 2024
1 parent 0605b53 commit 220e8a3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "speare"
version = "0.1.2"
version = "0.1.3"
edition = "2021"
license = "MIT"
description = "actor-like thin abstraction over tokio::task and flume channels"
Expand Down
5 changes: 5 additions & 0 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,11 @@ where
&self.handle
}

/// Clears all the messages from the mailbox.
pub fn clear_mailbox(&self) {
self.msg_rx.drain();
}

/// Spawns and supervises a child `Process`.
/// ## Examples
///
Expand Down

0 comments on commit 220e8a3

Please sign in to comment.