bothy-sdk
    Preparing search index...

    Class Adapter

    Connects an AgentHandler to the server.

    const adapter = new Adapter(config, new Lotse(), { clock: fake.clock });
    adapter.source = new RecordingSource(await adapter.makeSource());
    const done = adapter.run();
    await adapter.stop();
    await done;
    Index

    Constructors

    Properties

    client: ApiClient

    The REST client; every request of a run's handler is bound to the run (07 SR9).

    clock: Clock

    The time source.

    The adapter configuration.

    handler: AgentHandler

    The runtime side.

    inbox: InboxStore

    The inbox of accepted events (and the jti store of the verifier).

    outbox: Outbox

    The outbox of replies and writes.

    settings: SdkSettings

    The resolved SDK settings.

    source: EventSource | undefined

    The event source; set it before Adapter.run to wrap the default one.

    verifier: InvocationVerifier | undefined

    The token check, created by Adapter.run.

    Methods

    • Returns the agent heartbeat of this process (09 4.8), active_runs included.

      Returns {}

      The heartbeat (generated type).

      RangeError when a configured name or version breaks the heartbeat forms.

    • Builds the source transport names, for a test to wrap before Adapter.run.

      Returns Promise<EventSource>

      The gateway or polling source of this adapter.

      ProblemError when the discovery failed.

      adapter.source = new TamperingSource(await adapter.makeSource(), rewrite);
      
    • Runs until the source stops or Adapter.stop is called.

      Returns Promise<CloseReason>

      Why the adapter stopped (for example 4015 when another process took the consumer over, or 1000 after Adapter.stop).

      ProblemError when the discovery or the first JWKS fetch failed.

    • Stops the source; Adapter.run returns after the current delivery. Handler work stops being awaited; an entry whose run has not started stays in the inbox for the next process (09 4.9).

      Returns Promise<void>

      A promise that resolves once the source is closing.