Options
All
  • Public
  • Public/Protected
  • All
Menu

RedisBroker implements MessageBroker using the Redis in-memory database. Messages are not durable and will not survive a broker restart.

Hierarchy

  • RedisBroker

Implements

Index

Constructors

Methods

Constructors

constructor

  • Constructs a RedisBroker with the given RedisOptions object.

    Parameters

    • Optional options: RedisOptions

      The configuration of the connection. If undefined, will connect over TCP to the default server at localhost.

    Returns RedisBroker

    A RedisBroker that is connected to the specified Redis server.

Methods

disconnect

  • disconnect(): Promise<void>
  • Quickly disconnects from the Redis server. Should only be called once. Any operations in flight are cancelled.

    Returns Promise<void>

    A Promise that resolves when the connection is servered.

end

  • end(): Promise<void>
  • Gently disconnects from the Redis server. Should only be called once.

    Returns Promise<void>

    A Promise that resolves when all operations in flight are executed and the connection is severed.

publish

  • Publishes the given message to the Redis server. Publishing is emulated by LPUSHing to celery. Workers use RPOP to extract tasks from the queue.

    Parameters

    • message: TaskMessage

      The message to be published. Serialized to UTF-8 encoded JSON before being LPUSHed onto celery.

    Returns Promise<string>

    A Promise that resolves to the response of the Redis server after the LPUSH operation is completed.

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