Python client library for Google Cloud Platform services including Datastore, Storage, and Pub/Sub
Overall
score
93%
A service that pulls and processes messages from a cloud messaging queue with configurable processing timeouts.
@generates
class MessageProcessor:
"""
Processes messages from a subscription with automatic deadline management.
"""
def __init__(self, subscription, processing_timeout=60):
"""
Initialize the processor.
Args:
subscription: The subscription object to pull messages from
processing_timeout: Maximum time in seconds to process a message before extending deadline
"""
pass
def process_messages(self, max_messages=5):
"""
Pull and process messages from the subscription.
Args:
max_messages: Maximum number of messages to pull (default: 5)
Returns:
A list of dictionaries with keys 'message_id', 'data', and 'status'
where status is either 'acknowledged' or 'extended'
"""
pass
def _handle_message(self, ack_id, message):
"""
Process a single message and manage its acknowledgment deadline.
Args:
ack_id: The acknowledgment ID for the message
message: The message object to process
Returns:
A dictionary with message details and processing status
"""
passProvides Cloud Pub/Sub functionality for message queue operations.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/pypi-gcloudevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10