1.120.0 • Published 7 months ago

@biorate/batcher v1.120.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

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

MIT

Copyright (c) 2021-present Leonid Levkin (llevkin)

1.96.0

11 months ago

1.90.0

12 months ago

1.120.0

7 months ago

1.95.1

11 months ago

1.91.5

12 months ago

1.95.0

11 months ago

1.91.4

12 months ago

1.93.1

11 months ago

1.91.3

12 months ago

1.93.0

11 months ago

1.91.2

12 months ago

1.91.1

12 months ago

1.91.0

12 months ago

1.100.0

9 months ago

1.104.0

9 months ago

1.102.0

9 months ago

1.102.1

9 months ago

1.76.3

1 year ago

1.80.0

1 year ago

1.81.0

1 year ago

1.82.0

1 year ago

1.83.0

1 year ago

1.83.1

1 year ago

1.65.4

2 years ago

1.54.0

2 years 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

3 years ago

1.28.1

3 years ago

1.28.0

3 years ago

1.30.0

2 years ago

1.26.0

3 years ago

1.27.2

3 years ago

1.27.0

3 years ago

1.27.1

3 years ago

1.24.0

3 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