Skip to main content
Module

x/grammy_runner/sink.ts

Scale grammY bots
Latest
import * as grammyRunner from "https://deno.land/x/grammy_runner@v2.0.3/sink.ts";

Functions

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.

Creates an update sink that handles updates concurrently. In other words, new updates will be fetched—and their processing will be started—before the processing of older updates completes. The maximal number of concurrently handled updates can be limited (default: 500).

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.

Interfaces

Options for creating an update sink.

Update consumers are objects that can process an update from the Telegram Bot API. When you call run(bot), such an object will be created automatically for you. The passed bot will process the updates.

An update sink is an object that acts as the sink for updates for a runner. It features a handle function that takes in a batch of updates in the form of an array. It returns a promise that should resolve with a positive integral number soon as the sink is ready to handle further updates. The resolved number indicates how many updates the sink is ready to handle next.