Skip to content

Set number of threads for async executor provider as a system property #2631

@olavloite

Description

@olavloite

The ExecutorProvider that is used for the Async API in the client library can be set using the SpannerOptions$Builder#setAsyncExecutorProvider method. This makes it possible for direct users of the Async API to determine the type of executor and the number of threads to use. This configuration is however not accessible to anyone using an abstraction on top of the client library, such as the Spanner R2DBC driver, unless that abstraction has also added support for this configuration property to their own API.

When no ExecutorProvider has been set, the Java client library will use a default 8-thread Executor. The '8 threads' is currently hard-coded. We should change this hard-coded value into one that can be set with a system property, so users of both the client library and any driver that builds on top of it can set a different default.

Metadata

Metadata

Assignees

Labels

api: spannerIssues related to the googleapis/java-spanner API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions