Skip to content

Commit

Permalink
more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
shekhirin committed Aug 28, 2024
1 parent 5725e0b commit 6e69df2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions crates/exex/exex/src/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,19 @@ impl ExExNotificationsSubscriber {

/// Subscribe to notifications with the given head. Notifications will be sent starting from the
/// head, not inclusive.
///
/// When the return value is dropped, the subscription is cancelled.
pub fn subscribe_with_head(&mut self, head: ExExHead) -> &mut ExExNotifications {
self.state_tx.send(ExExNotificationsState::Active(Some(head))).unwrap();
&mut self.notifications
}

/// Subscribe to notifications.
///
/// When the return value is dropped, the subscription is cancelled.
/// It means that you will miss some of the notifications that could have arrived while the
/// subscription is inactive. To prevent this, you can use [`Self::subscribe_with_head`] to
/// explictly pass the head where you stopped and continue from there.

Check failure on line 187 in crates/exex/exex/src/manager.rs

View workflow job for this annotation

GitHub Actions / codespell

explictly ==> explicitly
pub fn subscribe(&mut self) -> &mut ExExNotifications {
self.state_tx.send(ExExNotificationsState::Active(None)).unwrap();
&mut self.notifications
Expand Down

0 comments on commit 6e69df2

Please sign in to comment.