Skip to content

Commit

Permalink
chore: refactored poll_reserve logic to be a seperate function
Browse files Browse the repository at this point in the history
  • Loading branch information
mw2000 committed Jun 5, 2024
1 parent 097f655 commit 4ddf85c
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions crates/exex/src/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ impl ExExHandle {
)
}

// Reserves a slot in the `PollSender` channel.
fn poll_reserve(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<(), PollSendError<ExExNotification>>> {
self.sender.poll_reserve(cx)
}
/// Reserves a slot in the `PollSender` channel and sends the notification if the slot was
/// successfully reserved.
///
Expand All @@ -102,7 +109,7 @@ impl ExExHandle {
);

self.next_notification_id = notification_id + 1;
return Poll::Ready(Ok(()))
return Poll::Ready(Ok(()));
}
}
// Do not handle [ExExNotification::ChainReorged] and
Expand All @@ -118,11 +125,13 @@ impl ExExHandle {
%notification_id,
"Reserving slot for notification"
);
match self.sender.poll_reserve(cx) {
Poll::Ready(Ok(())) => (),
match self.poll_reserve(cx) {
Poll::Ready(Ok(())) => {}
other => return other,
}

// self.poll_reserve(cx);

debug!(
exex_id = %self.id,
%notification_id,
Expand Down

0 comments on commit 4ddf85c

Please sign in to comment.