FAQ | This is a LIVE service | Changelog

Verified Commit 3278f332 authored by Hal Blackburn's avatar Hal Blackburn
Browse files

feat: add @message_handler() decorator

The decorator supports event handler functions that process message
events (currently GCP Pub/Sub messages, wrapped in CloudEvents). The
functions receive messages as instances of a data type they choose, that
represents the parsed payload of the message events they subscribe to.

This decorator allows event handler functions to accept message data as
a type representing the decoded payload of a message event. For example,
a Pydantic model representing a JSON payload.

- Validating incoming message metadata envelope
- Parsing/validating the message payload
- Recording the message envelope metadata in the function's
  `ExecutionInfo` result

Handler functions can focus on processing decoded message data payloads,
without needing to do their own parsing and validation or event metadata
logging/reporting.
parent b8950fe4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment