File tree 3 files changed +7
-3
lines changed
3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 1
1
[package ]
2
2
name = " ticked_async_executor"
3
- version = " 0.2.0 "
3
+ version = " 0.2.1 "
4
4
authors = [" coder137" ]
5
5
edition = " 2021"
6
6
description = " Local executor that runs woken async tasks when it is ticked"
Original file line number Diff line number Diff line change 89
89
90
90
pub fn create_timer ( & self ) -> TickedTimer {
91
91
let tick_recv = self . rx_tick_event . clone ( ) ;
92
- TickedTimer { tick_recv }
92
+ TickedTimer :: new ( tick_recv)
93
93
}
94
94
95
95
pub fn tick_channel ( & self ) -> tokio:: sync:: watch:: Receiver < f64 > {
Original file line number Diff line number Diff line change 1
1
pub struct TickedTimer {
2
- pub tick_recv : tokio:: sync:: watch:: Receiver < f64 > ,
2
+ tick_recv : tokio:: sync:: watch:: Receiver < f64 > ,
3
3
}
4
4
5
5
impl TickedTimer {
6
+ pub fn new ( tick_recv : tokio:: sync:: watch:: Receiver < f64 > ) -> Self {
7
+ Self { tick_recv }
8
+ }
9
+
6
10
pub async fn sleep_for ( mut self , mut duration_in_ms : f64 ) {
7
11
loop {
8
12
let _r = self . tick_recv . changed ( ) . await ;
You can’t perform that action at this time.
0 commit comments