Skip to content

Commit

Permalink
Add .await
Browse files Browse the repository at this point in the history
  • Loading branch information
mdeloof committed Jan 8, 2025
1 parent e94e183 commit 17e52c2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion statig/src/awaitable/inner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ where

/// Transition from the current state to the given target state.
pub async fn transition(&mut self, mut target: M::State, context: &mut M::Context<'_>) {
M::before_transition(&mut self.shared_storage, &self.state, &target);
M::before_transition(&mut self.shared_storage, &self.state, &target).await;

// Get the transition path we need to perform from one state to the next.
let (exit_levels, enter_levels) = self.state.transition_path(&mut target);
Expand Down
6 changes: 4 additions & 2 deletions statig/src/awaitable/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ where
shared_storage,
StateOrSuperstate::Superstate(&superstate),
event,
);
)
.await;

let response = superstate
.call_handler(shared_storage, event, context)
Expand All @@ -131,7 +132,8 @@ where
shared_storage,
StateOrSuperstate::Superstate(&superstate),
event,
);
)
.await;

match response {
Response::Handled => break Response::Handled,
Expand Down

0 comments on commit 17e52c2

Please sign in to comment.