JobRunner
Runs dispatched jobs once each: claimed at once, then proving, then submitted
with the transaction; finalized comes from the settlement watch. Redispatches of a
job already running are ignored; a reconnect re-reads unfinished jobs from the relay.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new JobRunner(
client,handlers,onSubmitted?):JobRunner
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
client |
RelayClient |
handlers |
Partial<Record<JobDispatch["kind"], JobHandler>> |
onSubmitted? |
(job, txId) => void |
Returns
Section titled “Returns”JobRunner
Properties
Section titled “Properties”client
Section titled “client”
readonlyclient:RelayClient
handlers
Section titled “handlers”
readonlyhandlers:Partial<Record<JobDispatch["kind"],JobHandler>>
onSubmitted?
Section titled “onSubmitted?”
readonlyoptionalonSubmitted?: (job,txId) =>void
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
job |
JobDispatch |
txId |
string |
Returns
Section titled “Returns”void