Class BrokerClient

Hierarchy

Constructors

  • Parameters

    • transport: ClientTransportAdapter

    Returns BrokerClient

Properties

activeChannels: Map<string, BrokerChannel<any>> = ...
entityFieldsPromise?: Promise<void>
entityFieldsReceived: boolean = false

On first getEntityFields() call we check if entityFieldsReceived is true. If not we connect and load all available entity-fields from the server and start streaming all changes to the entity-fields directly to our entityFields map.

knownEntityFields: Map<string, string[]> = ...
publishedEntityFields: Map<string, Map<string, number>> = ...

Methods

  • Parameters

    • classSchema: string | ClassType<any>

    Returns Promise<string[]>

  • Type Parameters

    • T

    Parameters

    • id: string

    Returns Promise<undefined | Uint8Array>

  • Type Parameters

    • T

    Parameters

    • id: string
    • Optional value: number

    Returns Promise<number>

  • Locks an id on the broker. If the id is already locked, it waits until it is released. If timeout is specified, the lock acquisition should take maximum timeout seconds. 0 means it waits without limit.

    ttl (time to life) defines how long the given lock is allowed to stay active. Per default each lock is automatically unlocked after 30 seconds. If you haven't released the lock until then, another lock acquisition is allowed to receive it anyways. ttl of 0 disables ttl and keeps the lock alive until you manually unlock it (or the process dies).

    Parameters

    • id: string
    • ttl: number = 30
    • timeout: number = 0

    Returns Promise<AsyncSubscription>

  • Type Parameters

    • T

    Parameters

    • classSchema: string | ClassType<any>
    • fields: string[]

    Returns Promise<AsyncSubscription>

  • Type Parameters

    • T

    Parameters

    • id: string
    • data: Uint8Array

    Returns Promise<undefined>

  • Tries to lock an id on the broker. If the id is already locked, it returns immediately undefined without locking anything

    ttl (time to life) defines how long the given lock is allowed to stay active. Per default each lock is automatically unlocked after 30 seconds. If you haven't released the lock until then, another lock acquisition is allowed to receive it anyways. ttl of 0 disables ttl and keeps the lock alive until you manually unlock it (or the process dies).

    Parameters

    • id: string
    • ttl: number = 30

    Returns Promise<undefined | AsyncSubscription>

Generated using TypeDoc