-
Notifications
You must be signed in to change notification settings - Fork 90
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
feat: add RPC priority support #324
Conversation
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.
LG overall however there is some functionality missing.
First, all commit methods should support this, including Batch.commit()
.
Secondly, we usually call commit on behalf of the user which means they will not be able to pass the options to the commit call themselves. This means we need to provide alternate ways of passing in the options. e.g.
database.run_in_transaction(transaction_func, request_options={"priority": "PRIORITY_LOW"})
for database.batch(request_options={"priority": "PRIORITY_MEDIUM"}) as batch:
batch.insert(table, columns, data)
Additionally, you should update the PR description to give context on the feature and how it should be used. For example, it should mention that all requests are run as PRIORITY_HIGH
by default and so this feature is to deprioritize tasks.
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.
Some minor docstring nits :)
Co-authored-by: larkee <31196561+larkee@users.noreply.github.com>
Co-authored-by: larkee <31196561+larkee@users.noreply.github.com>
No region tags are edited in this PR.This comment is generated by snippet-bot.
|
… rpc-priority # Conflicts: # google/cloud/spanner_v1/__init__.py # tests/unit/test_transaction.py
Add client library support to enable users to optionally specify a priority level on their requests. All requests are run as
PRIORITY_HIGH
by default, this allows tasks to be deprioritised.