1.120.0 • Published 8 months ago

@biorate/batcher v1.120.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 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

12 months ago

1.90.0

1 year ago

1.120.0

8 months ago

1.95.1

12 months ago

1.91.5

1 year ago

1.95.0

12 months ago

1.91.4

1 year ago

1.93.1

12 months ago

1.91.3

1 year ago

1.93.0

12 months ago

1.91.2

1 year ago

1.91.1

1 year ago

1.91.0

1 year ago

1.100.0

10 months ago

1.104.0

10 months ago

1.102.0

10 months ago

1.102.1

10 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

3 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