pateka - ordered parallel asynchronous tasks
$ npm install pateka
Creating a new pateka. By default a pateka will be created with (parallel) 256 tracks, each track than will be filled with async tasks based on their routing key. Tasks in the same track ( same routing key ) will be run in order, tracks will be run in parallel.
const Pateka = ;const Pateka = ;
Setting the number of (parallel) tracks
You can chnage the default number of tracks by passing a
tracks option to the constructor.
const Pateka = tracks: 128 ;
Task are added with the
add method. You will need to specify an
id for the task, a
task function, and a
The routingKey will be used to spread tasks into tracks, ensuring that tasks with the same key are always run in the right order and sequence.
Awaiting a task to be done
Copyright (c) 2018 eCollect AG. Licensed under the MIT license.