createRedisStateAdapter
FunctionExperimentalSignature
function createRedisStateAdapter(__namedParameters): RedisStateAdapter;redis/src/state-adapter/state-adapter.redis.ts:298
Parameters
- __namedParameters
object - __namedParameters.countCap?
numberPer-status count at whichcountChainsByTypeNameandcountJobsByTypeNamestop counting and reporthasMore: true. - __namedParameters.generateJobId?(
) => stringFunction to generate new job IDs. Must return unique values: creating a job whose ID already exists throws. - __namedParameters.generateWorkerId?(
) => stringFunction to generate the worker ID of a worker runner created without aworkerId. Called once per worker runner, which keeps the ID across restarts. Must return a new ID on every call. - __namedParameters.keyPrefix?
stringPrefix of every key the adapter writes. It must contain a non-empty hash tag such as{queuert}, so a cluster stores every key in one slot; the factory throws otherwise. - __namedParameters.maxBlockersPerJob?
numberMost blocker chains a single job may declare. Declaring more throwsBlockerLimitExceededErrorbefore any state is written. - __namedParameters.maxTransactionTries?
numberMost tries of one transaction before it throws RedisTransactionConflictError. - __namedParameters.stateProviderThe provider the adapter runs its Lua scripts through.
- __namedParameters.validateJobId?(
id) =>booleanPredicate returningtrueif the ID is acceptable. Core runs it on both generated and caller-supplied IDs before writing; failures throwInvalidJobIdError. - __namedParameters.validateWorkerId?(
id) =>booleanPredicate returningtrueif the worker ID is acceptable. Core runs it on both generated and caller-supplied worker IDs when the worker runner is created; failures throwInvalidWorkerIdError.