(&mut self)
| 48 | } |
| 49 | |
| 50 | pub fn next_action(&mut self) -> NextAction { |
| 51 | let next_time = if let Some(next) = self.next_event_time() { |
| 52 | next |
| 53 | } else { |
| 54 | return NextAction::None; |
| 55 | }; |
| 56 | |
| 57 | let now = Utc::now(); |
| 58 | if now > next_time { |
| 59 | // we need to trigger some timers |
| 60 | NextAction::Run |
| 61 | } else { |
| 62 | NextAction::Wait(next_time) |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | pub async fn trigger_timers(&mut self) -> Vec<IntervalTimer> { |
| 67 | let next_time = if let Some(next) = self.next_event_time() { |
no test coverage detected