Avena Webapp API - v0.0.1
    Preparing search index...

    Class NatsService

    Open connection to central NATS plus the KV manager bound to it.

    Returned by connect and passed to the KV helpers and the exporter client.

    Index

    Constructors

    Properties

    Methods

    Constructors

    • Wraps an established connection and its KV manager.

      Parameters

      • connection: NatsConnection

        Open NATS connection.

      • kvm: Kvm

        KV manager created from connection.

      Returns NatsService

    Properties

    buckets: Map<string, Promise<KV>> = ...

    Buckets opened by NatsService.bucket, by name.

    connection: NatsConnection

    Open WebSocket connection to central NATS.

    kvm: Kvm

    Key-Value manager bound to the active connection.

    Methods

    • Opens a KV bucket once per connection and returns the same handle afterwards.

      Opening only binds a handle to the bucket's stream; the helpers below used to do it on every call. A failed open is not kept, so the next call tries again.

      Parameters

      • name: string

        KV bucket name, e.g. avenabox.

      Returns Promise<KV>

      The bucket handle.