FIxed the timer and the example
This commit is contained in:
@@ -1,7 +0,0 @@
|
|||||||
import system::async::(set_timer, yield)
|
|
||||||
import system::io::(readln, println)
|
|
||||||
|
|
||||||
const main := (
|
|
||||||
set_timer true 1 (println "y" yield)
|
|
||||||
\cancel. readln \a. cancel
|
|
||||||
)
|
|
||||||
9
examples/yes/main.orc
Normal file
9
examples/yes/main.orc
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import system::async::(set_timer, yield)
|
||||||
|
import system::io::(readln, println)
|
||||||
|
import std::exit_status
|
||||||
|
|
||||||
|
const main := (
|
||||||
|
set_timer true 1 (println "y" yield) \cancel.
|
||||||
|
readln \a.
|
||||||
|
cancel exit_status::success
|
||||||
|
)
|
||||||
@@ -101,7 +101,7 @@ impl<TEv, TOnce, TRec: Clone + Send> Poller<TEv, TOnce, TRec> {
|
|||||||
TimerKind::Recurring { period, data_cell } => {
|
TimerKind::Recurring { period, data_cell } => {
|
||||||
let data = data_cell.clone_out()?;
|
let data = data_cell.clone_out()?;
|
||||||
self.timers.push(Timer {
|
self.timers.push(Timer {
|
||||||
expires,
|
expires: expires + period,
|
||||||
kind: TimerKind::Recurring { period, data_cell },
|
kind: TimerKind::Recurring { period, data_cell },
|
||||||
});
|
});
|
||||||
PollEvent::Recurring(data)
|
PollEvent::Recurring(data)
|
||||||
|
|||||||
Reference in New Issue
Block a user