Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TopicCacheEntry

An entry for the topic cache

Hierarchy

Index

Constructors

constructor

  • Create a new TopicCacheEntry instance

    Parameters

    Returns TopicCacheEntry

Properties

Private Readonly path

path: string

The topic path

Private Readonly specification

specification: TopicSpecification

The topic specification

Private Readonly streams

streams: StreamAdapter[]

The stream adapters

Methods

addStream

  • Add a new stream

    If this is the first stream, any fallback streams will be notified of an unsubscription and will not receive any more updates

    throws

    an InvalidDataError if any value received is incompatible with the data type or does not represent a valid value.

    Parameters

    Returns void

getTopicPath

  • getTopicPath(): string
  • Get the topic path

    Returns string

    the topic path

getTopicSpecification

  • Get the topic specification

    Returns TopicSpecification

    the topic specification

Abstract handleDelta

Abstract handleValue

Protected notifyDelta

  • notifyDelta(oldContent: Uint8Array | null, content: Uint8Array, delta: BinaryDelta | null, oldValue: any, newValue: any, registry: StreamRegistryImpl): void
  • Notify a stream of a delta event

    Parameters

    • oldContent: Uint8Array | null

      the buffer containing the old content

    • content: Uint8Array

      the content as a Uint8Array

    • delta: BinaryDelta | null

      the binary delta

    • oldValue: any

      the old value of the topic

    • newValue: any

      the new value of the topic

    • registry: StreamRegistryImpl

      the stream registry

    Returns void

notifyInitialSubscription

  • Notify all streams of the initial subscription

    Parameters

    Returns void

Private notifySubscription

  • Notify a stream of a new subscription

    throws

    an InvalidDataError if any value received is incompatible with the data type or does not represent a valid value.

    Parameters

    Returns void

notifyUnsubscription

  • Notify all streams of an unsubscription

    Parameters

    Returns void

Protected notifyValue

  • notifyValue(oldContent: Uint8Array | null, content: Uint8Array, oldValue: any, newValue: any, registry: StreamRegistryImpl): void
  • Notify a stream of a new value

    Parameters

    • oldContent: Uint8Array | null

      the buffer containing the old content

    • content: Uint8Array

      the content as a Uint8Array

    • oldValue: any

      the old value of the topic

    • newValue: any

      the new value of the topic

    • registry: StreamRegistryImpl

      the stream registry

    Returns void

Abstract notifyValueToNewStream

  • Notify a value to a new stream

    This is called when a new stream is added. Implementations should call the stream's onValue handler with the cached value

    throws

    an InvalidDataError if the value is incompatible with the data type, or buffer does not represent a valid value.

    Parameters

    Returns void

proxies

  • Get the stream adapters

    If there are no streams in this entry, this will return the fallback streams that match the topic details

    Parameters

    Returns StreamAdapter[]

removeAllStreams

  • removeAllStreams(): void
  • Remove all streams

    No notifications will be sent

    Returns void

removeStream

  • Remove a stream

    If this was the last stream in the entry, any fallback streams will be notified of a subscription and will receive value and delta updates.

    Parameters

    Returns void

Copyright © 2025 DiffusionData Ltd. All Rights Reserved.