Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Writer<T>

Type parameters

  • T

    The type of the data to be written.

Hierarchy

  • Writer

Index

Constructors

Properties

Methods

Constructors

constructor

  • Creates a new Writer.

    Parameters

    • uri: string

      The uri of the redis server.

    • stream: string

      The name of the stream to write to.

    Returns Writer

  • Creates a new Writer.

    Parameters

    • uri: string

      The uri of the redis server.

    • stream: string

      The name of the stream to write to.

    • opts: WriterOptions

      The options for the writer.

    Returns Writer

  • Creates a new Writer.

    Parameters

    • client: Redis

      An IORedis client instance.

    • stream: string

      The name of the stream to write to.

    Returns Writer

  • Creates a new Writer.

    Parameters

    • client: Redis

      An IORedis client instance.

    • stream: string

      The name of the stream to write to.

    • opts: WriterOptions

      The options for the writer.

    Returns Writer

Properties

Private client

client: Redis

Private maxLength

maxLength: number

Private stream

stream: string

The name of the stream to write to.

Methods

disconnect

  • disconnect(): void
  • Disconnects from redis.

    Returns void

on

  • on(eventName: string, callback: listener): void
  • Attaches an event handler to the wrapped redis client.

    Parameters

    • eventName: string

      The name of the event to attach a handler to.

    • callback: listener

      The handler for the event.

    Returns void

write

  • write(data: T): Promise<string>
  • Writes a serializable value to the stream.

    Parameters

    • data: T

      The data to write to the stream.

    Returns Promise<string>

    The id for the written data.

Generated using TypeDoc