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
Streaming query support #112
Streaming query support #112
Changes from 9 commits
0b6c917
0372f2c
14d1c8e
1fbe25d
a1a6049
2231e19
9e3cacd
1c082cd
4509600
c412f06
21a54a8
487c650
4151402
bbd632b
31d060e
55c7f40
5ce2db7
d412ba5
2a23d5b
1f91110
afdfd2e
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.
Wouldn't this cause a "request 1" to lead to more than 1 message being sent? Is this acceptable or should we buffer the responses and deplete the buffer before asking more from upstream?
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, you are right! We could also do a round-robin without the buffer - no necessary invocations. What do you think?
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.
In line with comment below suggestion:
handleCancelRequest
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.
to avoid confusion, I suggest renaming. For example:
handleFlowControlRequest
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.
The use of
putIfAbsent
suggests that the given identifier may already exist. In that case, wouldn't we want to use the already existingQueryInProgess
instance? Of maybe reject the request altogether?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.
Semantically, I think we want to reject the request. If there is already the same query in progress, responses sent are valid, and responses to be sent are going to be valid. If you want a new result stream, issue a new query. If, however, receiving the same query twice is a result of a retry, rejecting it is also fine.
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.
Suggest: rename to
cancel()
Instead of completing normally, perhaps complete with a
QueryCancelledException
instead?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 sure whether we want to complete exceptionally here. Having a receiver cancelling the stream doesn't seem like an exceptional case but rather a regular one.