Polling worker for AWS StepFunctions.
npm install aws-step-father``
const StepFather = require('aws-step-father')
const AWS = require('aws-sdk')
const stepFunctions = new AWS.StepFunctions()
const worker = new StepFather(stepFunctions, {
activityArn:
executableMethod:
workerName:
pollInterval:
heartbeatInterval:
})
worker.on('success', (data) => console.log(Task ${data.taskToken} completed!))
worker.start()
``
#### Options
- activityArn: ARN string of activity (required)
- executableMethod: Method that will be executed with activity input. Must return a Promise. (required)
- workerName: Name of worker
- pollInterval: Polling interval for tasks, defaults to 65000
- heartbeatInterval: Heartbeat interval for tasks, defaults to 10000
- start: Emitted on task start.
- success: Emitted on task success.
- failure: Emitted on task failure.
- error: Emitted on communication error with StepFunctions API.