Interface IArvoEventHandler<TContract>

Interface for an ArvoEvent handler.

interface IArvoEventHandler<TContract> {
    contract: TContract;
    executionunits: number;
    handler: ArvoEventHandlerFunction<TContract>;
    spanOptions?: SpanOptions;
    systemErrorDomain?: (null | string)[];
}

Type Parameters

  • TContract extends ArvoContract

Properties

contract: TContract

The contract for the handler defining its input and outputs as well as the description.

executionunits: number

The default execution cost of the function. This can represent a dollar value or some other number with a rate card.

The functional handler of the event which takes the input, performs an action, and returns the result.

The input parameters for the handler function.

A promise of object containing the created ArvoEvent and optional extensions.

spanOptions?: SpanOptions

The OpenTelemetry span options

systemErrorDomain?: (null | string)[]

Optional configuration to customize where system error events are emitted.

This overrides the default system error domain fallback of: [event.domain, handler.contract.domain, null]

Use this to precisely control the set of domains that should receive structured sys.*.error events when uncaught exceptions occur in the handler.

Symbolic constants from ArvoDomain are supported.

undefineduses standard fallback broadcast domains