Skip to main content
Latest
function createBatchSink
import { createBatchSink } from "https://deno.land/x/grammy_runner@v2.0.3/mod.ts";

Creates an update sink that handles updates in batches. In other words, all updates of one batch are processed concurrently, but one batch has to be done processing before the next batch will be processed.

In the context of grammY, creating a batch sink is rarely useful. If you want to process updates concurrently, consider creating a concurrent sink. If you want to process updates sequentially, consider using a sequential sink.

This method was mainly added to provide compatibility with older frameworks such as telegraf. If your bot specifically relies on this behavior, you may want to choose creating a batch sink for compatibility reasons.

Type Parameters

Y
optional
R = unknown

Parameters

handler: UpdateConsumer<Y>

Update consumer

errorHandler: (error: R) => Promise<void>

Error handler for when the update consumer rejects

optional
options: SinkOptions<Y> = [UNSUPPORTED]

Further options for creating the sink

Returns

An update sink that handles updates batch by batch