Skip to content

Instantly share code, notes, and snippets.

@jwulf
Last active March 4, 2020 02:49
Show Gist options
  • Save jwulf/36f027a4db515b7f21c5d64a8c5f855f to your computer and use it in GitHub Desktop.
Save jwulf/36f027a4db515b7f21c5d64a8c5f855f 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',
taskHandler: myHandler,
jobBatchMinSize: 10, // first of: every 10 jobs
jobBatchMaxTime: 60, // or every 60 seconds
timeout: 80 // must be greater than jobBatchMaxTime
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment