Documentation
    Preparing search index...

    Type Alias ServiceHandlerOpts<I, O>

    type ServiceHandlerOpts<I, O> = {
        abortTimeout?: Duration | number;
        accept?: string;
        description?: string;
        idempotencyRetention?: Duration | number;
        inactivityTimeout?: Duration | number;
        ingressPrivate?: boolean;
        input?: Serde<I>;
        journalRetention?: Duration | number;
        metadata?: Record<string, string>;
        output?: Serde<O>;
    }

    Type Parameters

    • I
    • O
    Index

    Properties

    abortTimeout?: Duration | number

    This timer guards against stalled invocations that are supposed to terminate. The abort timeout is started after the [inactivityTimeout] has expired and the invocation has been asked to gracefully terminate. Once the timer expires, it will abort the invocation.

    This timer potentially interrupts user code. If the user code needs longer to gracefully terminate, then this value needs to be set accordingly.

    This overrides the abort timeout set for the service and the default set in restate-server.

    NOTE: You can set this field only if you register this endpoint against restate-server >= 1.4, otherwise the service discovery will fail.

    accept?: string

    Define the acceptable content-type for this handler when a request is received at the ingress. Wildcards can be used, e.g. application/* or * / *.

    If not provided, the input.contentType will be used instead as default.

    Setting this value has no effect on the input serde. If you want to customize how to deserialize the input, you still need to provide an input serde.

    description?: string

    An additional description for the handler, for documentation purposes.

    idempotencyRetention?: Duration | number

    The retention duration of idempotent requests to this handler.

    NOTE: You can set this field only if you register this endpoint against restate-server >= 1.4, otherwise the service discovery will fail.

    inactivityTimeout?: Duration | number

    This timer guards against stalled invocations. Once it expires, Restate triggers a graceful termination by asking the invocation to suspend (which preserves intermediate progress).

    The abortTimeout is used to abort the invocation, in case it doesn't react to the request to suspend.

    This overrides the inactivity timeout set for the service and the default set in restate-server.

    NOTE: You can set this field only if you register this endpoint against restate-server >= 1.4, otherwise the service discovery will fail.

    ingressPrivate?: boolean

    When set to true this handler cannot be invoked from the restate-server HTTP and Kafka ingress, but only from other services.

    NOTE: You can set this field only if you register this endpoint against restate-server >= 1.4, otherwise the service discovery will fail.

    input?: Serde<I>

    The Serde to use for deserializing the input parameter. defaults to: restate.serde.json

    Provide a custom Serde if the input is not JSON, or use: restate.serde.binary the skip serialization/deserialization altogether. in that case, the input parameter is a Uint8Array.

    journalRetention?: Duration | number

    The journal retention for invocations to this handler.

    In case the request has an idempotency key, the idempotencyRetention caps the journal retention time.

    NOTE: You can set this field only if you register this endpoint against restate-server >= 1.4, otherwise the service discovery will fail.

    metadata?: Record<string, string>

    Additional metadata for the handler.

    output?: Serde<O>

    The Serde to use for serializing the output. defaults to: restate.serde.json

    Provide a custom Serde if the output is not JSON, or use: restate.serde.binary the skip serialization/deserialization altogether. in that case, the output parameter is a Uint8Array.