-
-
Notifications
You must be signed in to change notification settings - Fork 166
Remove all listeners after emitting error in RequestHeaderParser #68
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
Remove all listeners after emitting error in RequestHeaderParser #68
Conversation
|
Ping @clue |
src/RequestHeaderParser.php
Outdated
| $this->parseAndEmitRequest(); | ||
| } catch (Exception $exception) { | ||
| $this->emit('error', [$exception]); | ||
| $this->emit('error', [$exception, $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.
Not a fan of this tbh. This should probably be discussed in the Stream component instead, but this messes with forwarding events.
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.
What would you suggest? Remove it here and from line 21, which would create a minor BC break. Or something else?
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.
I'm undecided tbh.
This change in itself looks okay to me, but I assume we may wan to remove these in an upcoming stream release anyway. This would obviously create a (minor) BC break, so this is not something that's going to happen soon anyway.
Let's put it this way: Has this line caused any issue for you? Do you mind reverting this line (and tests accordingly) and possibly PR title?
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.
Tbh I have no problem reverting this line and associated tests. This line hasn't caused any issues. I'll revert it 👍
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.
Reverted
|
Not sure why this PR isn't seeing my latest changes. Contacting github |
|
Turned out I committed it to my fork instead of the original repo here 😊 |
clue
left a comment
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.
PR title should be updated to reflect what this now does, otherwise LGTM 👍
…ctphp#68) * Ensure removeAllListeners on all error event in RequestHeaderParser * Ensure all error events from RequestHeaderParser emit $this as second item in event * Reverted emitting $this with error
Follow up on @clue's comment here: #65 (comment)