Skip to content

Conversation

kelunik
Copy link
Member

@kelunik kelunik commented Feb 9, 2017

Thanks @nrk for mentioning it again.

@nrk
Copy link

nrk commented Feb 9, 2017

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.

@kelunik
Copy link
Member Author

kelunik commented Feb 9, 2017

I can add a note to everything that creates a watcher, too.

@WyriHaximus
Copy link
Member

WyriHaximus commented Feb 9, 2017

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 👍

@nrk
Copy link

nrk commented Feb 9, 2017

@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.

@kelunik
Copy link
Member Author

kelunik commented Feb 9, 2017

@nrk I've added a note to every method creating a watcher and have clarified enable and disable.

@kelunik
Copy link
Member Author

kelunik commented Feb 17, 2017

Ready to merge?

@bwoebi bwoebi merged commit 1262ea4 into master Feb 17, 2017
@kelunik kelunik deleted the improved-enable-doc branch February 17, 2017 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants