-
Notifications
You must be signed in to change notification settings - Fork 10.1k
fixes to event encoding and acknowledgement #242
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
Changes from 1 commit
8c3b7d9
6879154
8e590cc
6985e46
485f212
942ed48
cb3d8b5
e648cc0
4a6591e
e63d67a
357dace
52dbc10
23ce067
920c681
afe0a50
63850a5
a31a048
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -263,13 +263,12 @@ Client.prototype.count = function (fn) { | |
| */ | ||
|
|
||
| Client.prototype.consume = function (fn) { | ||
| this.consumer = fn; | ||
| this.paused = false; | ||
|
|
||
| if (this.buffer.length) { | ||
| fn(this.buffer, null); | ||
| this.buffer = []; | ||
| } else { | ||
| this.consumer = fn; | ||
| } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was probably creating problems in certain circumstances. However, it never came up with our test suite. Any chance you can create a test to avoid a regression for this one?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, still can't run tests -- they just timeout, because of ECONNREFUSED, because of client should connect to server only when server is bound for real. Mac has magical kernel, it listen()s synchronously, PC's doesn't ;) update: |
||
|
|
||
| return this; | ||
|
|
@@ -283,7 +282,7 @@ Client.prototype.consume = function (fn) { | |
| */ | ||
|
|
||
| Client.prototype.publish = function (msg) { | ||
| if (this.paused || !this.consumer) { | ||
| if (this.paused) { | ||
| this.buffer.push(msg); | ||
| } else { | ||
| this.consumer(null, msg); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the packet is handled, the socket should have already been initialized in a readable state. What's the need for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the call to SocketNamespace#socket is moved to manager and done with explicit
true, no need remains.