Skip to main content

CloudEventHandlerFunction

@webda/cloudevents


Type Alias: CloudEventHandlerFunction<T>

CloudEventHandlerFunction<T> = (event, context) => Promise<CloudEvent | void> | CloudEvent | void

Defined in: cloudevents/src/services/cloudeventsreceiver.service.ts:29

Handle a received CloudEvent

A returned CloudEvent is the reply: it is sent back in the HTTP response (a Knative Broker delivers it like any event). A thrown error fails the delivery with a 500 so the sender retries, unless it is a WebdaError.HttpError which keeps its status (a 4xx refuses the event for good).

Type Parameters​

T​

T = any

Parameters​

event​

CloudEvent<T>

context​

WebContext

Returns​

Promise<CloudEvent | void> | CloudEvent | void