Skip to content

Pubsub Could Use Autocreate on Topics and Subscriptions #905

@waprin

Description

@waprin

I think this will be a recurring pattern:

topic = pubsub.Topic('book-process-queue')
if not topic.exists():
    topic.create()

subscription = pubsub.Subscription('book-sub', topic)
if not subscription.exists():
    subscription.create()

So it might be a good idea to simplify it to:

topic = pubsub.Topic('book-process-queue', auto_create=True)

gcloud-node does something like this already.

Metadata

Metadata

Assignees

Labels

api: pubsubIssues related to the Pub/Sub API.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions