1.83.1 • Published 10 months ago
@biorate/batcher v1.83.1
Tasks batcher
Tasks batcher
Features:
- Group single tasks into batch request
Examples:
import { inject, container, Types, Core } from '@biorate/inversion';
import { IConfig, Config } from '@biorate/config';
import { IBatcher, Batcher } from '@biorate/batcher';
const batcher: IBatcher = new Batcher<{ data: string }, { test: string }>();
batcher.register((tasks) => {
console.log(tasks);
// [
// [
// { data: 'one' },
// {
// resolve: [Function (anonymous)],
// reject: [Function (anonymous)],
// metadata: { test: 'one' }
// }
// ],
// [
// { data: 'two' },
// {
// resolve: [Function (anonymous)],
// reject: [Function (anonymous)],
// metadata: { test: 'two' }
// }
// ],
// [
// { data: 'three' },
// {
// resolve: [Function (anonymous)],
// reject: [Function (anonymous)],
// metadata: { test: 'three' }
// }
// ]
// ]
});
batcher.add({ data: 'one' }, { test: 'one' });
batcher.add({ data: 'two' }, { test: 'two' });
batcher.add({ data: 'three' }, { test: 'three' });
Learn
- Documentation can be found here - docs.
Release History
See the CHANGELOG
License
Copyright (c) 2021-present Leonid Levkin (llevkin)
1.76.3
12 months ago
1.80.0
10 months ago
1.81.0
10 months ago
1.82.0
10 months ago
1.83.0
10 months ago
1.83.1
10 months ago
1.65.4
1 year ago
1.54.0
1 year ago
1.38.2
2 years ago
1.38.3
2 years ago
1.38.1
2 years ago
1.38.4
2 years ago
1.42.2
2 years ago
1.42.1
2 years ago
1.30.12
2 years ago
1.29.0
2 years ago
1.28.1
2 years ago
1.28.0
2 years ago
1.30.0
2 years ago
1.26.0
2 years ago
1.27.2
2 years ago
1.27.0
2 years ago
1.27.1
2 years ago
1.24.0
2 years ago
1.15.0
3 years ago
1.14.0
3 years ago
1.17.0
3 years ago
1.16.0
3 years ago
1.11.2
3 years ago
1.8.0
3 years ago