-
Notifications
You must be signed in to change notification settings - Fork 37
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
Dicer hangs when used with stream/promises
' pipeline
#26
Comments
Investigated it and the issue appears to be the |
This module is due for a rewrite now that node should have all of the necessary hooks to accomplish what the hacks were previously doing. I'm not sure when that will happen though. |
@mscdex I think I'm about to do that in TypeScript. Would you be interested in me contributing it back? |
More importantly, what ideas do you have for an API? Object mode streams instead of part event? |
What I had in mind was just removing the event hacks, using ES6 Classes, and other code cleanup (that doesn't cause noticeable performance regressions).... nothing breaking. |
Sounds good. I think I could try doing that, if you don't mind me submitting a PR. |
Have at it. |
Instead overriding `emit` method and using `this._realFinish` to detect unexpected end of data - implement `_final` method and track the logic there. The only behavior change from the use of `_final` is that we would no longer emit `finish` when the input data is terminated early. Instead we would emit `error` as before and stop the processing. Note that this is the behavior provided by `stream.Writable`, and it is thus conformant with the specification. Additionally, replace uses of private `_events` property with either straight `emit()` with return value check, or `listenerCount()` in the situations where there might be an overhead from the constructed event arguments. Fix: mscdex#26
Instead overriding `emit` method and using `this._realFinish` to detect unexpected end of data - implement `_final` method and track the logic there. The only behavior change from the use of `_final` is that we would no longer emit `finish` when the input data is terminated early. Instead we would emit `error` as before and stop the processing. Note that this is the behavior provided by `stream.Writable`, and it is thus conformant with the specification. Additionally, replace uses of private `_events` property with either straight `emit()` with return value check, or `listenerCount()` in the situations where there might be an overhead from the constructed event arguments. Fix: mscdex#26
Instead overriding `emit` method and using `this._realFinish` to detect unexpected end of data - implement `_final` method and track the logic there. The only behavior change from the use of `_final` is that we would no longer emit `finish` when the input data is terminated early. Instead we would emit `error` as before and stop the processing. Note that this is the behavior provided by `stream.Writable`, and it is thus conformant with the specification. Additionally, replace uses of private `_events` property with either straight `emit()` with return value check, or `listenerCount()` in the situations where there might be an overhead from the constructed event arguments. Replace `emit('error', error)` with `destroy(error)` calls as well, as otherwise the behavior is undefined. Fix: mscdex#26
Instead overriding `emit` method and using `this._realFinish` to detect unexpected end of data - implement `_final` method and track the logic there. The only behavior change from the use of `_final` is that we would no longer emit `finish` when the input data is terminated early. Instead we would emit `error` as before and stop the processing. Note that this is the behavior provided by `stream.Writable`, and it is thus conformant with the specification. Additionally, replace uses of private `_events` property with either straight `emit()` with return value check, or `listenerCount()` in the situations where there might be an overhead from the constructed event arguments. Replace `emit('error', error)` with `destroy(error)` calls as well, as otherwise the behavior is undefined. Fix: mscdex#26
Test case:
The text was updated successfully, but these errors were encountered: