GCP - Cloud Pub/Sub
Consider this code snippet for a pull subscription client in Python using Google Cloud Pub/Sub:
from google.cloud import pubsub_v1
subscriber = pubsub_v1.SubscriberClient()
subscription_path = subscriber.subscription_path('my-project', 'my-sub')
response = subscriber.pull(subscription=subscription_path, max_messages=1)
print(len(response.received_messages))
What will this code print if there is exactly one message available in the subscription?