async-service-builder
Build small async services
Installation
npm i async-service-builder
or
yarn add async-service-builder
Usage
; ; ; serviceA; // runs every 5 secondsserviceB; // runs every 10 seconds
API
build(worker: () => Promise, timeout = 5000): () => Promise
Build a new service which pauses for timeout
between runs.
Won't crash when the worker throws.
It will terminate it self when the process exits.