Options
All
  • Public
  • Public/Protected
  • All
Menu

redis-currents

Index

Type aliases

ConsumerOptions

ConsumerOptions: object

Type declaration

  • Optional block?: undefined | number

    The amount of time in milliseconds which the Redis client should block before timing out. When a timeout occurs, the Consumer will loop back around and re-initiate a group read.

    Set to '0' to never timeout.

    Note that any given Redis client using a blocking operation like XREADGROUP will block all other commands from being issued on the same connection while it is pending.

  • Optional count?: undefined | number

    The max number of messages to deliver for each read.

  • Optional from?: undefined | string

    The id of the message to start consuming from.

    Pass '0' to begin from the start of the data in the stream. Pass '$' to begin with new messages written to the stream.

DeserializedPair

DeserializedPair: [Id, T]

Emitter

Emitter: object

Type declaration

  • on: function
    • on(eventName: string, callback: listener): void

Id

Id: string

OpenOptions

OpenOptions: object

Type declaration

  • Optional block?: undefined | number
  • Optional client?: IORedis.Redis
  • Optional consumer?: undefined | string
  • Optional count?: undefined | number
  • Optional from?: undefined | string
  • Optional group?: undefined | string
  • Optional stream?: undefined | string

Pending

Pending: object

Type declaration

  • consumer: string

    The consumer the pending message was last delievered to.

  • created: Date

    The date on which the pending message was written to the stream.

  • deliveries: number

    The number of times the pending message has been delivered so far.

  • group: string

    The group the pending message is in.

  • id: Id

    The id of the pending message.

  • stream: string

    The stream the pending message is in.

  • waiting: number

    The amount of time the pending message has been unacked.

PendingTuple

PendingTuple: [Id, string, number, number]

SerializedPair

SerializedPair: [Id, [never, string]]

Shape

Shape: object

Type declaration

  • a: number

WriterOptions

WriterOptions: object

Type declaration

  • Optional maxLength?: undefined | number

    The approximate max length for the redis stream.

    remarks

    This value is used by XADD to cap a stream.

listener

listener: function

Type declaration

    • (...args: any[]): void
    • Parameters

      • Rest ...args: any[]

      Returns void

Functions

Const deserialize

  • deserialize<T>(str: string): T

Const deserializePair

Const doneWithBacklog

  • doneWithBacklog<T>(items: T[]): boolean
  • Type parameters

    • T

    Parameters

    • items: T[]

    Returns boolean

Const fill

  • fill(n?: number): number[]
  • Fills an array of integers from 1..n.

    Parameters

    • Default value n: number = 1

      The count of elements.

    Returns number[]

Const id

  • id(): string

Const idToDate

  • idToDate(id: Id): Date

Const isConnectionClosedError

  • isConnectionClosedError(err: Error): boolean

Const isGroupAlreadyExistsError

  • isGroupAlreadyExistsError(err: Error): boolean

Const isNoGroupExistsError

  • isNoGroupExistsError(err: Error): boolean

Const on

  • on(emitter: Emitter, eventName: string): Promise<Object>
  • Returns a promise which resolves the first time a given event is raised.

    Parameters

    • emitter: Emitter

      The emitter to listen to.

    • eventName: string

      The event name to listen for.

    Returns Promise<Object>

Const serialize

  • serialize<T>(val: T): string

Const sleep

  • sleep(ms?: number): Promise<Object>
  • Returns a promise which resolves after ms milliseconds.

    Parameters

    • Default value ms: number = 0

      The number of milliseconds in which to resolve.

    Returns Promise<Object>

Const step

  • step<T>(consumer: Consumer<T>): Promise<[string, T]>

Object literals

Const defaultOptions

defaultOptions: object

block

block: number = 0

count

count: number = 1

from

from: string = "0"

maxLength

maxLength: number = 1000

Generated using TypeDoc