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

add progress event #107

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

add progress event #107

wants to merge 6 commits into from

Conversation

djulien
Copy link

@djulien djulien commented Nov 22, 2017

Added event to send progress info back to caller.

Copy link
Collaborator

@LinusU LinusU left a comment

Choose a reason for hiding this comment

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

I think that we should give a bit more thought to what goes in to the progress event. Could we find any examples of similar modules emitting similar events? I think it would be good to see what the rest of the ecosystem is doing...

package.json Outdated
@@ -1,6 +1,6 @@
{
"name": "speaker",
"version": "0.4.0",
"version": "0.4.1",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please don't bump the version in the PR, that's better left to the release process

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the replies.

For the version bump, I've worked on other projects where they did that. I'll take it out.

I was thinking that the call-back would loose context (I haven't worked with libuv much), but I can remove "THIS" if it's not needed.

For the naming conventions, there are a lot of styles out there. Is there an example style that I should use? WRT the actual data fields included in the event, I just put in there what I needed for my little use case, but other data can be added if appropriate. Or should it not put include any data, and then the receiver can just pull the data out of the object?

index.js Outdated
@@ -196,8 +196,12 @@ class Speaker extends Writable {
binding.write(handle, b, b.length, onwrite)
}

var THIS = this; //preserve "this" for onwrite call-back
Copy link
Collaborator

Choose a reason for hiding this comment

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

You don't need this variable since onwrite is an arrow-function

* `numwr` - the cumulative number of writes (this is related to the number of frames)
* `wrlen` - the number of bytes written this time
* `wrtotal` - the total number of bytes written
* `buflen` - the number of bytes currently remaining in the buffer
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we try and name these something more human friendly?

Choose a reason for hiding this comment

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

Actually it would be a kind of acknowledgement or ack .

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