Subscriber class¶
fastpubsub.Subscriber
¶
Subscriber(
func,
topic_name,
subscription_name,
retry_policy,
lifecycle_policy,
delivery_policy,
control_flow_policy,
dead_letter_policy=None,
middlewares=(),
project_id="",
)
A class representing a Pub/Sub subscriber.
Initializes the Subscriber.
| PARAMETER | DESCRIPTION |
|---|---|
func
|
The function to call when a message is received.
TYPE:
|
topic_name
|
The name of the topic to subscribe to.
TYPE:
|
subscription_name
|
The name of the subscription.
TYPE:
|
retry_policy
|
The retry policy for the subscription.
TYPE:
|
lifecycle_policy
|
The lifecycle policy for the subscription.
TYPE:
|
delivery_policy
|
The delivery policy for the subscription.
TYPE:
|
control_flow_policy
|
The control flow policy for the subscription.
TYPE:
|
dead_letter_policy
|
The dead-letter policy for the subscription.
TYPE:
|
middlewares
|
A sequence of middlewares to apply.
TYPE:
|
project_id
|
An alternative project id to create a subscription
TYPE:
|
Source code in fastpubsub/pubsub/subscriber.py
include_middleware
¶
Includes a middleware in the subscriber.
| PARAMETER | DESCRIPTION |
|---|---|
middleware
|
The middleware to include.
TYPE:
|
args
|
The positional arguments used on the middleware instantiation.
TYPE:
|
kwargs
|
The keyword arguments used on the middleware instantiation.
TYPE:
|