Flush all watchers on empty queue

This commit is contained in:
Fedor Indutny 2021-03-25 17:00:03 -07:00 committed by GitHub
parent 67892d838c
commit 746e99b8c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 317 additions and 89 deletions

View file

@ -6,6 +6,7 @@ import { createBatcher } from './batcher';
import { createWaitBatcher } from './waitBatcher';
const updateMessageBatcher = createBatcher<MessageAttributesType>({
name: 'messageBatcher.updateMessageBatcher',
wait: 500,
maxSize: 50,
processBatch: async (messageAttrs: Array<MessageAttributesType>) => {
@ -31,6 +32,7 @@ export function setBatchingStrategy(keepBatching = false): void {
}
export const saveNewMessageBatcher = createWaitBatcher<MessageAttributesType>({
name: 'messageBatcher.saveNewMessageBatcher',
wait: 500,
maxSize: 30,
processBatch: async (messageAttrs: Array<MessageAttributesType>) => {