Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Watch<T>

Watches are a way of specifying a view of data (e.g. list of nodes, KV pairs, health checks) which is monitored for updates. When an update is detected, an Handler with WatchResult is invoked. All errors, except java.util.concurrent.TimeoutException, will be handled, with resubscribing with a progressive delay. All timeout errors will be ignored, with resubscribing without any delay. As an example, you could watch the status of health checks and notify when a check is critical.

Type parameters

  • T

Hierarchy

  • Watch

Index

Methods

setHandler

  • Set the result handler. As data is changed, the handler will be called with the result.

    Parameters

    Returns Watch<T>

start

  • Start this Watch

    Returns Watch<T>

stop

  • stop(): void
  • Stop the watch and release its resources

    Returns void

Static events

  • Creates Watch to monitoring the custom user events. The underlying Consul client will be created with default options. This maps to the /v1/event/list API internally.

    Parameters

    • event: string
    • vertx: Vertx

    Returns Watch<EventList>

  • Creates Watch to monitoring the custom user events. This maps to the /v1/event/list API internally.

    Parameters

    Returns Watch<EventList>

Static key

  • Creates Watch to monitoring a specific key in the KV store. The underlying Consul client will be created with default options. This maps to the /v1/kv/ API internally.

    Parameters

    • key: string
    • vertx: Vertx

    Returns Watch<KeyValue>

  • Creates Watch to monitoring a specific key in the KV store. This maps to the /v1/kv/ API internally.

    Parameters

    Returns Watch<KeyValue>

Static keyPrefix

  • Creates Watch to monitoring a prefix of keys in the KV store. The underlying Consul client will be created with default options. This maps to the /v1/kv/ API internally.

    Parameters

    • keyPrefix: string
    • vertx: Vertx

    Returns Watch<KeyValueList>

  • Creates Watch to monitoring a prefix of keys in the KV store. This maps to the /v1/kv/ API internally.

    Parameters

    Returns Watch<KeyValueList>

Static nodes

  • Creates Watch to monitoring the list of available nodes. The underlying Consul client will be created with default options. This maps to the /v1/catalog/nodes API internally.

    Parameters

    • vertx: Vertx

    Returns Watch<NodeList>

  • Creates Watch to monitoring the list of available nodes. This maps to the /v1/catalog/nodes API internally.

    Parameters

    Returns Watch<NodeList>

Static service

  • Creates Watch to monitoring the nodes providing the service. Nodes will be sorted by distance from the consul agent. The underlying Consul client will be created with default options. This maps to the /v1/health/service/<service> API internally.

    Parameters

    • service: string
    • vertx: Vertx

    Returns Watch<ServiceEntryList>

  • Creates Watch to monitoring the nodes providing the service. Nodes will be sorted by distance from the consul agent. This maps to the /v1/health/service/<service> API internally.

    Parameters

    Returns Watch<ServiceEntryList>

Static services

  • Creates Watch to monitoring the list of available services. The underlying Consul client will be created with default options. This maps to the /v1/catalog/services API internally.

    Parameters

    • vertx: Vertx

    Returns Watch<ServiceList>

  • Creates Watch to monitoring the list of available services. This maps to the /v1/catalog/services API internally.

    Parameters

    Returns Watch<ServiceList>

Generated using TypeDoc