This class allows to add jobs with dependencies between them in such a way that it is possible to build complex flows. Note: A flow is a tree-like structure of jobs that depend on each other. Whenever the children of a given parent are completed, the parent will be processed, being able to access the children's result data. All Jobs can be in different queues, either children or parents,

Hierarchy

  • InterimFlowProducer
    • FlowProducer

Constructors

  • Parameters

    • opts: QueueBaseOptions = {}

    Returns FlowProducer

Properties

closing: Promise<void>
keys: KeysMap
opts: QueueBaseOptions
queueKeys: QueueKeys
toKey: ((name, type) => string)

Type declaration

    • (name, type): string
    • Parameters

      • name: string
      • type: string

      Returns string

Accessors

  • get client(): Promise<RedisClient>
  • Returns a promise that resolves to a redis client. Normally used only by subclasses.

    Returns Promise<RedisClient>

Methods

  • Adds a flow.

    This call would be atomic, either it fails and no jobs will be added to the queues, or it succeeds and all jobs will be added.

    Parameters

    • flow: FlowJobPro

      an object with a tree-like structure where children jobs will be processed before their parents.

    • Optional opts: FlowOpts

      options that will be applied to the flow object.

    Returns Promise<JobNodePro>

  • Adds multiple flows.

    A flow is a tree-like structure of jobs that depend on each other. Whenever the children of a given parent are completed, the parent will be processed, being able to access the children's result data.

    All Jobs can be in different queues, either children or parents, however this call would be atomic, either it fails and no jobs will be added to the queues, or it succeeds and all jobs will be added.

    Parameters

    • flows: FlowJobPro[]

      an array of objects with a tree-like structure where children jobs will be processed before their parents.

    Returns Promise<JobNodePro[]>

  • Closes the connection and returns a promise that resolves when the connection is closed.

    Returns Promise<void>

  • Force disconnects a connection.

    Returns Promise<void>

  • Type Parameters

    • U extends keyof FlowProducerListener

    Parameters

    • event: U
    • Rest ...args: Parameters<FlowProducerListener[U]>

    Returns boolean

  • Get a flow.

    Parameters

    • opts: NodeOpts

      an object with options for getting a JobNode.

    Returns Promise<JobNode>

  • Type Parameters

    • U extends keyof FlowProducerListener

    Parameters

    • eventName: U
    • listener: FlowProducerListener[U]

    Returns FlowProducer

  • Type Parameters

    • U extends keyof FlowProducerListener

    Parameters

    • event: U
    • listener: FlowProducerListener[U]

    Returns FlowProducer

  • Type Parameters

    • U extends keyof FlowProducerListener

    Parameters

    • event: U
    • listener: FlowProducerListener[U]

    Returns FlowProducer

  • Returns Promise<RedisClient>

Generated using TypeDoc