Skip to content
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

Change the resumable query API #32

Merged
merged 1 commit into from
Sep 27, 2024
Merged

Conversation

mdumandag
Copy link
Contributor

There were couple of problems with it:

  • We don't use the async prefix in async method names in the public API
  • We don't return the result for APIs that returns Success string only

So, I have changed the implementation to fix these problems.

Also, I think it is much better to return the first batch of the results directly to the user, along with an handle to fetch more or stop. This is more similar to API we have in JS SDK, makes the possible misuses impossible (you can't call stop before the start anymore etc.), and makes more sense for the async version. For the async version, we previously marked the function async but did not call any async functions, which was weird.

Also, I have changed the tests a bit to make them more resillient to failures due to potentially delayed indexing, which might happen from time to time.

There were couple of problems with it:

- We don't use the async prefix in async method names in the public
API
- We don't return the result for APIs that returns Success string only

So, I have changed the implementation to fix these problems.

Also, I think it is much better to return the first batch of the results
directly to the user, along with an handle to fetch more or stop.
This is more similar to API we have in JS SDK, makes the possible misuses
impossible (you can't call stop before the start anymore etc.), and makes
more sense for the async version. For the async version, we previously
marked the function async but did not call any async functions, which
was weird.

ALso, I have changed the tests a bit to make them more resillient to
failures due to potentially delayed indexing, which might happen
from time to time.
@fahreddinozcan
Copy link
Collaborator

Yeah I kinda agree with this interface. Within the first PR, this was the interface that I was going with, but I changed it to be able to use with statements better, which I thought would be the default way to use. Thanks for the update.

@mdumandag mdumandag merged commit 0800e7c into master Sep 27, 2024
1 check passed
@mdumandag mdumandag deleted the resumable-query-refactor branch September 27, 2024 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants