createRedisStateAdapter

FunctionExperimental

Signature

function createRedisStateAdapter(__namedParameters): RedisStateAdapter;

redis/src/state-adapter/state-adapter.redis.ts:298

Parameters

  • __namedParameters
    object
  • __namedParameters.countCap?
    number
    Per-status count at which countChainsByTypeName and countJobsByTypeName stop counting and report hasMore: true.
  • __namedParameters.generateJobId?
    () => string
    Function to generate new job IDs. Must return unique values: creating a job whose ID already exists throws.
  • __namedParameters.generateWorkerId?
    () => string
    Function to generate the worker ID of a worker runner created without a workerId. Called once per worker runner, which keeps the ID across restarts. Must return a new ID on every call.
  • __namedParameters.keyPrefix?
    string
    Prefix 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?
    number
    Most blocker chains a single job may declare. Declaring more throws BlockerLimitExceededError before any state is written.
  • __namedParameters.maxTransactionTries?
    number
    Most tries of one transaction before it throws RedisTransactionConflictError.
  • __namedParameters.stateProvider
    The provider the adapter runs its Lua scripts through.
  • __namedParameters.validateJobId?
    (id) => boolean
    Predicate returning true if the ID is acceptable. Core runs it on both generated and caller-supplied IDs before writing; failures throw InvalidJobIdError.
  • __namedParameters.validateWorkerId?
    (id) => boolean
    Predicate returning true if the worker ID is acceptable. Core runs it on both generated and caller-supplied worker IDs when the worker runner is created; failures throw InvalidWorkerIdError.

Returns

esc

Search guides, integrations and every exported symbol.

↑ ↓ to navigate↵ to open