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 <code>Handler</code> with <code>AsyncResult</code> is invoked.
As an example, you could watch the status of health checks and notify when a check is critical.
package |
Default |
---|
__construct()
events( $arg0, $arg1, $arg2 = null) : \io\vertx\jphp\ext\consul\Watch<EventList>
The underlying Consul client will be created with default options. This maps to the /v1/event/list API internally.
param $event [string] the event name param $vertx [Vertx] the {@code Vertx} instance events($event, $vertx)
Creates Watch
to monitoring the custom user events.
This maps to the /v1/event/list API internally.
param $event [string] the event name param $vertx [Vertx] the {@code Vertx} instance param $options [ConsulClientOptions | array] the options to create underlying Consul client events($event, $vertx, $options)
string
Vertx
array | ConsulClientOptions
\io\vertx\jphp\ext\consul\Watch
the {@code Watch} instance
key( $arg0, $arg1, $arg2 = null) : \io\vertx\jphp\ext\consul\Watch<KeyValue>
The underlying Consul client will be created with default options. This maps to the /v1/kv/ API internally.
param $key [string] the key param $vertx [Vertx] the {@code Vertx} instance key($key, $vertx)
Creates Watch
to monitoring a specific key in the KV store.
This maps to the /v1/kv/ API internally.
param $key [string] the key param $vertx [Vertx] the {@code Vertx} instance param $options [ConsulClientOptions | array] the options to create underlying Consul client key($key, $vertx, $options)
string
Vertx
array | ConsulClientOptions
\io\vertx\jphp\ext\consul\Watch
the {@code Watch} instance
keyPrefix( $arg0, $arg1, $arg2 = null) : \io\vertx\jphp\ext\consul\Watch<KeyValueList>
The underlying Consul client will be created with default options. This maps to the /v1/kv/ API internally.
param $keyPrefix [string] the key param $vertx [Vertx] the {@code Vertx} instance keyPrefix($keyPrefix, $vertx)
Creates Watch
to monitoring a prefix of keys in the KV store.
This maps to the /v1/kv/ API internally.
param $keyPrefix [string] the key param $vertx [Vertx] the {@code Vertx} instance param $options [ConsulClientOptions | array] the options to create underlying Consul client keyPrefix($keyPrefix, $vertx, $options)
string
Vertx
array | ConsulClientOptions
\io\vertx\jphp\ext\consul\Watch
the {@code Watch} instance
nodes( $arg0, $arg1 = null) : \io\vertx\jphp\ext\consul\Watch<NodeList>
The underlying Consul client will be created with default options. This maps to the /v1/catalog/nodes API internally.
param $vertx [Vertx] the {@code Vertx} instance nodes($vertx)
Creates Watch
to monitoring the list of available nodes.
This maps to the /v1/catalog/nodes API internally.
param $vertx [Vertx] the {@code Vertx} instance param $options [ConsulClientOptions | array] the options to create underlying Consul client nodes($vertx, $options)
Vertx
array | ConsulClientOptions
\io\vertx\jphp\ext\consul\Watch
the {@code Watch} instance
service( $arg0, $arg1, $arg2 = null) : \io\vertx\jphp\ext\consul\Watch<ServiceEntryList>
The underlying Consul client will be created with default options. This maps to the /v1/health/service/<service> API internally.
param $service [string] the service name param $vertx [Vertx] the {@code Vertx} instance service($service, $vertx)
Creates Watch
to monitoring the nodes providing the service.
This maps to the /v1/health/service/<service> API internally.
param $service [string] the service name param $vertx [Vertx] the {@code Vertx} instance param $options [ConsulClientOptions | array] the options to create underlying Consul client service($service, $vertx, $options)
string
Vertx
array | ConsulClientOptions
\io\vertx\jphp\ext\consul\Watch
the {@code Watch} instance
services( $arg0, $arg1 = null) : \io\vertx\jphp\ext\consul\Watch<ServiceList>
The underlying Consul client will be created with default options. This maps to the /v1/catalog/services API internally.
param $vertx [Vertx] the {@code Vertx} instance services($vertx)
Creates Watch
to monitoring the list of available services.
This maps to the /v1/catalog/services API internally.
param $vertx [Vertx] the {@code Vertx} instance param $options [ConsulClientOptions | array] the options to create underlying Consul client services($vertx, $options)
Vertx
array | ConsulClientOptions
\io\vertx\jphp\ext\consul\Watch
the {@code Watch} instance
setHandler( $arg0) : $this
callable
$this
reference to this, for fluency
start() : $this
$this
reference to this, for fluency
stop() : void