Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc/modules/http.websocket.md: Add usage example to websocket:each() #118

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hollunder
Copy link

Since it wasn't obvious to me how to use each() I figure it would be useful to have a little example in the documentation.

@@ -53,6 +53,15 @@ The opcode `0x1` will be returned as `"text"` and `0x2` will be returned as `"bi

Iterator over [`websocket:receive()`](#http.websocket:receive).

This comment was marked as resolved.

for data, opcode in ws:each() do
print(data, opcode)
end

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove trailing new line.

@coveralls
Copy link

coveralls commented Jul 19, 2018

Coverage Status

Coverage decreased (-1.7%) to 86.204% when pulling d06eb6e on hollunder:master into 921e04d on daurnimator:master.

Copy link
Owner

@daurnimator daurnimator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you squash down your commits and use a commit message that matches the general form of the project?

@@ -53,6 +53,16 @@ The opcode `0x1` will be returned as `"text"` and `0x2` will be returned as `"bi

Iterator over [`websocket:receive()`](#http.websocket:receive).

#### Example {#http.websocket.each-example}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nit: this should be :each not .each

@hollunder
Copy link
Author

I hope it's OK now, I'm new to the whole PR workflow (and not that well versed in git either).

@hollunder
Copy link
Author

I'm a bit worried about the usefulness of the example beyond the general use of an iterator.
One of the original questions I had about it was what it actually iterates over and I can't confidently answer it now either. Nor does it show how to sensibly break out of this loop.

@daurnimator
Copy link
Owner

Do you want to edit your PR further? Or do you think it improves the current docs and should be merged?

@daurnimator
Copy link
Owner

Ping @hollunder ?

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.

3 participants