ticks indicate whether event have happened, after record ticks we register event to reactor and return Pending. if event happen immediately, tick will be:
let tick = self
.reactor
.ticker
.fetch_add(1, Ordering::SeqCst)
.wrapping_add(1);
because reactor block on wait, which will cause ticks.0 equal to tick when we wake this task. and we reregister event to reactor and wake again. this time ticks.0 increase 1, and we return Poll::Ready now.
IMO ticks.0 is useless maybe we can just use ticks.1 to indicate whether event has happened. or we can set state[dir].tick = tick + 1.