Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 cancellation support to all async operations #66
Add cancellation support to all async operations #66
Changes from 3 commits
d53dab8
6978967
a01480c
2c9e833
111e48e
91920e7
1198fcd
2487cae
51c2055
4e077f2
a18c3b7
3d6248d
503399b
c12aeed
7e6c3db
da1f64b
48740af
5f0266e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Can we put this into a function rather than inlining it here?
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.
Are you thinking of a function that accepts
delivery
as an argument, and then still in-lining, something like: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 suppose this must work or else CI wouldn't run but the package.json says we're using TS 3.5.
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.
That's because 3.5.1 is the minimum version 😄 But that does remind me that before a new version is published, we should evaluate if down-leveled types are needed.
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.
Ah, right! :)
It's a dev dependency anyways - so should we bump it up?
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.
Removed optional chaining in c12aeed to avoid rocking the boat regarding TS versions
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 curious here as well what happens if the server does close the connection with an error.
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 believe the way rhea is set up is to fire events and not throw errors. If there are listeners, they respond, else the fired event gets ignored. There is no unhandled exceptions
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.
Why isn't
abortSignal
just in theAwaitableSenderOptionsWithSession
?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.
AwaitableSenderOptionsWithSession
extendsAwaitableSenderOptions
which extendsBaseSenderOptions
SenderOptionsWithSession
extendsSenderOptions
which extendsBaseSenderOptions
.ReceiverOptionsWithSession
extendsReceiverOptions
So, the right place to add the abortSignal would have been
BaseSenderOptions
andReceiverOptions
But then,
createRequestResponseLink()
takes bothSenderOptions
andReceiverOptions
. Both options supportingabortSignal
would be not be desirable for this method. So, I could either do thePick
/Omit
magic, or keepabortSignal
separate as done here. I chose the latter.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.
Why isn't
abortSignal
just in theReceiverOptionsWithSession
?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.
Answered in https://github.com/amqp/rhea-promise/pull/66/files#r464826879