Scheduler#
Schedulers provide means to schedule callbacks asynchronously.
These are used by the subscriber to call the user-provided callback to process each message.
-
class
google.cloud.pubsub_v1.subscriber.scheduler.
Scheduler
[source]# Abstract base class for schedulers.
Schedulers are used to schedule callbacks asynchronously.
-
abstract property
queue
# A concurrency-safe queue specific to the underlying concurrency implementation.
This queue is used to send messages back to the scheduling actor.
- Type
-
abstract property
-
class
google.cloud.pubsub_v1.subscriber.scheduler.
ThreadScheduler
(executor=None)[source]# A thread pool-based scheduler.
This scheduler is useful in typical I/O-bound message processing.
- Parameters
executor (concurrent.futures.ThreadPoolExecutor) – An optional executor to use. If not specified, a default one will be created.
-
property
queue
# A thread-safe queue used for communication between callbacks and the scheduling thread.
- Type