OptionalonCalled when the server ends or closes the job stream without an error. Exceptions thrown by the callback, and rejections of a returned promise, are caught and logged.
OptionalonCalled when the job stream fails: a stream error event, or a failed
attempt to open the stream. Exceptions thrown by the callback, and
rejections of a returned promise, are caught and logged.
OptionalonCalled just before each attempt to re-open a dead stream. attempt is
the number of consecutive failed streams or open attempts, starting at 1.
It resets once a re-opened stream delivers a job or stays up for at least
maxDelayMs. Exceptions thrown by the callback, and rejections of a
returned promise, are caught and logged.
OptionalstreamRe-open the stream when it dies. Defaults to true, with exponential
backoff starting at 1000ms and capped at 30000ms. Pass false to disable
reconnection (the onStream* callbacks still fire), or an object to tune
the backoff. After a re-opened stream is established, one backfill poll
runs to pick up jobs that were created while the stream was down.
Options controlling how
streamJobsreports and recovers from a job stream that dies (stream error, server-side end/close, or a failed open).