Timer#cancel shouldn't be called from inside a compute block because it deletes the timer id from the map being computed
Once it's deleted, the timer is no longer re-entrant, and multiple timers will be created.
On the second call to after, the timer id will be deleted from timers object. Although the first timer gets cancelled, the second timer is no longer kept track of. On the third call, a new timer is created whilst the second timer remains active, thus violating the reentrancy.
Timer#cancel shouldn't be called from inside a compute block because it deletes the timer id from the map being computed
Once it's deleted, the timer is no longer re-entrant, and multiple timers will be created.
On the second call to
after
, the timer id will be deleted fromtimers
object. Although the first timer gets cancelled, the second timer is no longer kept track of. On the third call, a new timer is created whilst the second timer remains active, thus violating the reentrancy.