Options
All
  • Public
  • Public/Protected
  • All
Menu

Redis in-memory database result backend. Uses connection pooling with one connection per active subscriber.

Hierarchy

  • RedisBackend

Implements

Index

Constructors

Methods

Constructors

constructor

  • Parameters

    • Optional options: RedisOptions

      The options to construct new clients with. If undefined, will use the default options from Redis.Options

    Returns RedisBackend

    A RedisBackend with an empty connection pool.

Methods

delete

  • delete(taskId: string): Promise<string>
  • Uses DELETE. If a result is in flight (not yet published and set), must be called again after the result has been set for it to be removed from Redis.

    Parameters

    • taskId: string

      The UUID of the task whose result is to be deleted from Redis.

    Returns Promise<string>

    A Promise that resolves to the DELETE response.

disconnect

  • disconnect(): Promise<void>
  • Gently terminates the connection with Redis using QUIT. Same as #end.

    see

    #end

    Returns Promise<void>

    A Promise that resolves to the QUIT response from Redis.

end

  • end(): Promise<void>
  • Gently terminates the connection with Redis using QUIT.

    Returns Promise<void>

    A Promise that resolves to the QUIT response from Redis.

get

  • Uses two connections to SUBSCRIBE to the correct key ID, then try GET. If GET returns a successful result, immediately UNSUBSCRIBE, parse the message, and fulfill the Promise. Otherwise, wait until a successful result is received on the subscribed connection and resolve to the parsed result.

    Type parameters

    • T

    Parameters

    • __namedParameters: object

    Returns Promise<ResultMessage<T>>

    A Promise that resolves to the result received from Redis.

put

  • Sets and publishes a value with the same key as the message's task ID. Implemented with a MULTI SETEX PUBLISH EXEC pipeline.

    Type parameters

    • T

    Parameters

    Returns Promise<string>

    A Promise that resolves to the response of the Redis server after the message has been set and published.

uri

  • uri(): string

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc