Created
March 4, 2020 02:58
-
-
Save jwulf/5141d26d600cbec3a90819d2dc81a0e9 to your computer and use it in GitHub Desktop.
A code example from the article https://joshwulf.com/blog/2020/03/zb-batch-worker/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ZBClient } from 'zeebe-node' | |
const zbc = new ZBClient() | |
const batchWorker = zbc.createZBBatchWorker({ | |
taskType: 'rate-limited-api-call', | |
jobBatchMinSize: 10, | |
jobBatchMaxTime: 60, | |
timeout: 80, | |
taskHandler: (jobs, worker) => { | |
jobs.forEach(job => { | |
worker.log(`Completing job ${job.jobKey}`) | |
job.success() | |
}) | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment