Closed trowski closed 8 years ago
I'd explicitly specify invalid or cancelled. This eliminates every ambiguity. Cancelling may or may not invalidate the watcher internally immediately. The guarantee is that it will be invalidated after the next tick and will not be called after cancellation anymore.
Do we maybe want to explicitly add (on Driver interface) that disable()
never invalidates a watcher?
I agree, I'll add that as well.
Cancelling may or may not invalidate the watcher internally immediately.
I'd say it should do that immediately.
@kelunik yes, should. But that's an implementation detail we have no control of.
It's something we can define. Then we have the control.
It may eventually depend on the loop implementation. I.e. uv internally only releases it on the next tick. (to avoid freed memory access; see also uv_close() on libuv docs)
Addresses #58. Adds
InvalidWatcherExeption
that should be thrown ifenable
,disable
,cancel
,reference
, orunreference
is attempted with an invalid watcher identifier.