Closed kelunik closed 7 years ago
Correct me if I'm wrong, but the behaviour of onReadable()
, onWritable()
and such methods still seems kind of vague to me. I think it should be stated clearly in their docs if the watcher being returned is already enabled by the driver or the underlying implementation (e.g. no need for the user to call enable()
after onReadable()
) or not.
I can add a note to everything that creates a watcher, too.
The current changes make the default behavior a lot clearer but also adding a note to everything that creates a watcher is a good idea :+1:
@kelunik IMHO simply specifying that "Watchers created by this method MUST be immediatly marked as enabled." (or something along these lines) in the phpdocs of onWritable()
, onReadable()
, onSignal()
, defer()
, delay()
, repeat()
is more than enough.
This is actually different from the behaviour described for enable()
, which tells how the driver should act when enabling a watcher.
@nrk I've added a note to every method creating a watcher and have clarified enable
and disable
.
Ready to merge?
Thanks @nrk for mentioning it again.