Class Stream<T, ClientType>

Stream implements an Asynchronous Iterable over messages received from a topic. As such can be used with constructs like for-await-of, yield*, array destructing, etc.

Type Parameters

  • T

  • ClientType = any

Hierarchy

  • Stream

Constructors

  • Type Parameters

    • T

    • ClientType = any

    Parameters

    • client: Client<ClientType>
    • topics: string[]
    • decoder: MessageDecoder<T>
    • Optional contentTopicUpdater: ContentTopicUpdater<T>
    • Optional onConnectionLost: OnConnectionLostCallback

    Returns Stream<T, ClientType>

Properties

callback: undefined | ((env) => Promise<void>)

Type declaration

    • (env): Promise<void>
    • Parameters

      • env: Envelope

      Returns Promise<void>

client: Client<ClientType>
messages: T[]
onConnectionLost?: OnConnectionLostCallback
resolvers: ((value) => void)[]

Type declaration

    • (value): void
    • Parameters

      • value: IteratorResult<T, any>

      Returns void

subscriptionManager?: SubscriptionManager
topics: string[]

Methods

  • Returns AsyncIterableIterator<T>

  • Returns Promise<IteratorResult<T, any>>

  • Returns Promise<IteratorResult<T, any>>

  • Type Parameters

    • T

    • ClientType = string

    Parameters

    • client: Client<ClientType>
    • topics: string[]
    • decoder: MessageDecoder<T>
    • Optional contentTopicUpdater: ContentTopicUpdater<T>
    • Optional onConnectionLost: OnConnectionLostCallback

    Returns Promise<Stream<T, ClientType>>

Generated using TypeDoc