async-interop / event-loop

An event loop interface for interoperability in PHP.
MIT License
169 stars 9 forks source link

(Re-)Introduce InvalidWatcherException #72

Closed bwoebi closed 8 years ago

bwoebi commented 8 years ago

Fixes #58.

Followup to #69 with the following rules:

Any operation must happen on a valid watcher, except cancel(), which does not check watcher validity (and just silently returns).

bwoebi commented 8 years ago

May everyone please add a :+1: or add a comment with his problems so that we can eventually merge it if there are no complaints.

AndrewCarterUK commented 8 years ago

Might be worth being explicit that cancel should not throw an exception when given an invalid watcher if this is the route we are going down.

bwoebi commented 8 years ago

It's present on the Driver::cancel docs:

  • Cancel a watcher. This marks the watcher as invalid. Calling this function MUST never fail, even when passed an invalid watcher.

It already has no @throws annotation, that should be good enough for Loop::cancel() docs.