Closed mbrancato closed 2 weeks ago
mbrancato The recommended approach to use the library to subscribe to messages is via the subscriber client in the google/cloud/pubsub_v1
code path as opposed to using google/pubsub_v1/
code path. To clarify, is there a reason / end goal that you are trying to get to via this pubsub_v1 code path instead of cloud/pubsub_v1 code path?
Closing since there isn't a response, but feel free to reopen if required.
When using
google.pubsub_v1.SubscriberAsyncClient
, awaiting the coroutine methodstreaming_pull
may hang forever with no indication as to why. This is due to creating theSubscriberAsyncClient
outside an existing event loop / async function.Note: I'm only able to produce this on MacOS.
Environment details
Python 3.11.10
pip 24.0
google-cloud-pubsub
version:Steps to reproduce
SubscriberAsyncClient
outside an event loopsubscriber.streaming_pull()
Code example
To make this "work", move the subscriber inside the main async function.
Stack trace
Making sure to follow these steps will guarantee the quickest resolution possible.
Thanks!