createBatchSink
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
Y
R
R = unknown
Parameters
handler
handler: UpdateConsumer<Y>
Update consumer
errorHandler
Error handler for when the update consumer rejects
options
options: SinkOptions<Y>
Further options for creating the sink
Return Type
UpdateSink<Y>
An update sink that handles updates batch by batch