Closed drug007 closed 3 years ago
This is intended behavior, which should be explicitly documented. There are one or two exceptions to this rule in the library, but generally:
cancel
is not invoked, the callback is guaranteed to be called exactly oncecancel
is called before the callback has been invoked, the callback will not be called at allThis is important for the fiber based code in vibe.d to be able to reliably implement scoped waiting for events. It might make sense though to add a higher-level timer API akin to eventcore.socket
that provides an additional method that automatically calls wait
again, for cases where the callback based API is used directly.
OS: windows 8 x64
It looks like timer continue to work but callback is not called. Or it is the intended behaviour?
it outputs:
It seems that the timer is still alive but its callback is not called anymore. If you uncomment the commented line it works as expected.