Skip to main content
Version: v8.0.0

BatchDeliveryType

Batching delivery. The first message opens a window of interval milliseconds; when it closes, every message collected in it is delivered at once as an array, in arrival order. Nothing is dropped. Best for event-like data (trades, chat messages, logs) where every message must be processed.


Import
import { BatchDeliveryType } from "@hyper-fetch/sockets"

Preview​

type BatchDeliveryType = {
interval: number;
maxSize?: number;
strategy: batch;
}

Structure​

BatchDeliveryType
NameTypeDescription
interval
number

Window length in milliseconds, measured from the first message of a batch.

maxSize
number

Deliver early as soon as this many messages were collected. Defaults to no limit.

strategy
batch