Skip to content

docs: clarify that Schedulers shouldn't be used with multiple SubscriberClients #100

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 1 commit into from
May 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion google/cloud/pubsub_v1/subscriber/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ def callback(message):
inundated with too many messages at once.
scheduler (~google.cloud.pubsub_v1.subscriber.scheduler.Scheduler): An optional
*scheduler* to use when executing the callback. This controls
how callbacks are executed concurrently.
how callbacks are executed concurrently. This object must not be shared
across multiple SubscriberClients.

Returns:
A :class:`~google.cloud.pubsub_v1.subscriber.futures.StreamingPullFuture`
Expand Down
3 changes: 2 additions & 1 deletion google/cloud/pubsub_v1/subscriber/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ def _make_default_thread_pool_executor():


class ThreadScheduler(Scheduler):
"""A thread pool-based scheduler.
"""A thread pool-based scheduler. It must not be shared across
SubscriberClients.

This scheduler is useful in typical I/O-bound message processing.

Expand Down