@toa.io/conveyor

0.24.0-alpha.0 • Public • Published

Conveyor

TL;DR

const conveyor = new Conveyor(processor)
const response = await conveyor.process(unit)

See types.


Responsibility

Batches and sequentially processes units. Units are batched while processor's response is awaited.

Processor

If processor returns an array of results R[], then amount of results must match amount of given units otherwise ProcessorException will be thrown. If processor returns R then it is returned as a result for all processed units.

Scaling Notice

Important
If Conveyor is used for batch insert into a database, scaling up instances of the corresponding component may result in lower overall request processing rate due to higher amount of database commits.

Readme

Keywords

none

Package Sidebar

Install

npm i @toa.io/conveyor

Homepage

toa.io

Weekly Downloads

432

Version

0.24.0-alpha.0

License

MIT

Unpacked Size

7.02 kB

Total Files

8

Last publish

Collaborators

  • agurtovoi