Skip to content

Commit

Permalink
Add helper to TimedContext too
Browse files Browse the repository at this point in the history
  • Loading branch information
goodhoko committed Aug 6, 2024
1 parent 3f2cd77 commit 3812a90
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/timed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ impl<M> TimedContext<M> {
// The recipient() call allows conversion from M to TimedMessage<M>.
self.system_handle.subscribe_recipient::<M, E>(self.myself.recipient());
}

pub fn subscribe_and_receive_latest<E: Event + Into<M>>(&self) -> Result<(), SendError>
where
M: 'static,
{
self.system_handle.subscribe_and_receive_latest::<M, E>(self.myself.recipient())
}
}

/// A wrapper around actors to add ability to receive delayed and recurring messages.
Expand Down

0 comments on commit 3812a90

Please sign in to comment.