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

Creates an update sink that handles updates sequentially, i.e. one after another. No update will be processed before the previous update has not either been processed, or its processing has failed and the error has been handled.

In the context of grammY, this is also the default behavior of the built-in bot.start method. Sequential sinks are very predictable and hence are well suited for debugging your bot. They do not scale well and should hence not be used in a larger bot, or one with long-running middleware.

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 one by one