File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 11[package ]
22name = " ticked_async_executor"
3- version = " 0.2.0 "
3+ version = " 0.2.1 "
44authors = [" coder137" ]
55edition = " 2021"
66description = " Local executor that runs woken async tasks when it is ticked"
Original file line number Diff line number Diff line change 8989
9090 pub fn create_timer ( & self ) -> TickedTimer {
9191 let tick_recv = self . rx_tick_event . clone ( ) ;
92- TickedTimer { tick_recv }
92+ TickedTimer :: new ( tick_recv)
9393 }
9494
9595 pub fn tick_channel ( & self ) -> tokio:: sync:: watch:: Receiver < f64 > {
Original file line number Diff line number Diff line change 11pub struct TickedTimer {
2- pub tick_recv : tokio:: sync:: watch:: Receiver < f64 > ,
2+ tick_recv : tokio:: sync:: watch:: Receiver < f64 > ,
33}
44
55impl TickedTimer {
6+ pub fn new ( tick_recv : tokio:: sync:: watch:: Receiver < f64 > ) -> Self {
7+ Self { tick_recv }
8+ }
9+
610 pub async fn sleep_for ( mut self , mut duration_in_ms : f64 ) {
711 loop {
812 let _r = self . tick_recv . changed ( ) . await ;
You can’t perform that action at this time.
0 commit comments