Skip to content

Change polling behavior #114

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

Merged
merged 2 commits into from
Aug 4, 2023
Merged

Change polling behavior #114

merged 2 commits into from
Aug 4, 2023

Conversation

mattt
Copy link
Contributor

@mattt mattt commented Aug 4, 2023

Related to #106

This PR makes the following two changes to the wait method:

  • Removes the max_attempts option. To stop polling for a prediction to complete, you can either return false in a callback passed to the stop parameter of the wait method, or call predictions.cancel. Or if polling via the run method, you can pass an AbortSignal to the signal property.
  • Updates the polling interval for a prediction from 250ms to 500ms. This is a more reasonable default for most use cases, and it brings this project in line with the Python client's behavior.

@mattt mattt marked this pull request as draft August 4, 2023 11:28
@mattt mattt marked this pull request as ready for review August 4, 2023 12:58
@mattt mattt merged commit edeed24 into main Aug 4, 2023
@mattt mattt deleted the mattt/wait-options branch August 4, 2023 12:58
@mattt mattt mentioned this pull request Aug 4, 2023
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.

1 participant