This repo contains two POCs for the Agenda locking mechanism.
install dependencies either yarn install
or npm install
.
Docker-compose should be available
The first poc validates one instance running. The results in results-singleinstance-execcount.json
show that all jobs ran essentially the same number of times and with no overlaps.
To run this poc: npm agenda
with docker-compose up
The second poc validates that even with two instances, both of them execute the jobs about the same amount of times (fairly distributed load). Results for each instance are at results-twoinstances-exectimes-{instance}.json
and results-twoinstances-execcount-{instance}.json
. The compiled results are in results-twoinstances-final.json
and results-twoinstances-overlap.json
.
To reproduce run in two separate terminal shells:
npm agenda2 -- 1
and npm agenda2 -- 2
with docker-compose up. After finishing the agendas compile the result with npm calculate