Skip to content

Instantly share code, notes, and snippets.

@jwulf
Created March 4, 2020 02:58
Show Gist options
  • Save jwulf/5141d26d600cbec3a90819d2dc81a0e9 to your computer and use it in GitHub Desktop.
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/
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