A plugin for handling Flatfile Jobs.
@flatfile/plugin-job-handler
package is a plugin designed to streamline handling Flatfile Jobs,
which are a large unit of work performed asynchronously on a resource such as a file, Workbook, or Sheet.listener.on('job:ready')
job
parameter is applied as a filter when listening for job:ready
.handler
parameter is a callback where you execute your code. It accepts two arguments: event
and tick
.event
: Represents the FlatfileEvent
, giving context to the handler.tick
: A function that can be used to update Job progress. It accepts two parameters:
progress
: A number between 0 and 100 indicating the progress percentage.message
: An optional descriptive string.tick
function returns a promise that resolves to a JobResponse object. However, using the tick
function is optional.debug
parameter is used to enable debug logging for the plugin.jobHandler
plugin manages Flatfile Jobs. It listens for the job:ready
event and screens it based on the job
parameter.
When a job:ready
event occurs:
handler
callback is triggered with the FlatfileEvent
and an optional tick
function.tick
function, if used, updates the Job’s progress.handler
may yield a promise that culminates in a JobResponse
object, allowing for a customized successful Job status."domain:operation"
with the domain and operation you want to listen for.