Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upevent-stream.readable overcalls async function #2
Comments
This comment has been minimized.
This comment has been minimized.
|
you are right. I'm gonna test this now. |
dominictarr
closed this
Oct 31, 2011
dominictarr
reopened this
Oct 31, 2011
This comment has been minimized.
This comment has been minimized.
|
I've confirmed this issue. okay, I figured it out, it's calling get again in resume. which is happening when map emits 'drain'... but also, readable should not allow multiple read calls at once. |
This comment has been minimized.
This comment has been minimized.
|
okay, this issue is fixed on 0.5.2 |
dominictarr
closed this
Nov 1, 2011
This comment has been minimized.
This comment has been minimized.
|
okay, I fixed the issue with map as well, in 0.5.3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
fireflymantis commentedOct 31, 2011
Running the following:
I think the above should, once a second, write out a new line looking something like {ok: true, n: 1} where n increments every time. Instead it works correctly momentarily, but begins to 'double up' with every call. It will print n = 1, then two lines n = 2, 3. Followed with four lines, n = 4, 5, 6, 7, then eight, sixteen, etc etc.
I looked into the event-stream index.js file and I'm having some trouble tracking down why this behavior is occurring.. It looks like the .readable(fn) function has an embedded get() method which gets passed to the function passed into the original call, kicking off the next cycle... That is, I'm not quite sure how get() or func() is being called twice.