ConfigRetriever

Defines a configuration retriever that read configuration from

and tracks changes periodically.

package

Default

Methods

__construct

__construct() 

Closes the retriever.

close() : void

configStream

configStream() : \io\vertx\jphp\config\ReadStream<JsonObject>

Response

\io\vertx\jphp\config\ReadStream

the stream of configurations. It's single stream (unicast) and that delivers the last known config and the successors periodically.

Creates an instance of the default implementation of the @see \io\vertx\jphp\config\ConfigRetriever, using the default settings (json file, system properties and environment variables).

create( $arg0,  $arg1 = null) : \io\vertx\jphp\config\ConfigRetriever
static

param $vertx [Vertx] the vert.x instance create($vertx)

Creates an instance of the default implementation of the @see \io\vertx\jphp\config\ConfigRetriever.

param $vertx [Vertx] the vert.x instance param $options [ConfigRetrieverOptions | array] the options, must not be {@code null}, must contain the list of configured store. create($vertx, $options)

Arguments

$arg0

Vertx

$arg1

array | ConfigRetrieverOptions

Response

\io\vertx\jphp\config\ConfigRetriever

the created instance.

Gets the last computed configuration.

getCachedConfig() : array

Response

array

the last configuration

Reads the configuration from the different and computes the final configuration.

getConfig( $arg0) : void

Arguments

$arg0

callable

Same as @see \io\vertx\jphp\config\ConfigRetriever::getConfig, but returning a object. The result is a

getConfigAsFuture( $arg0) : \io\vertx\jphp\config\Future<JsonObject>
static

.

Arguments

$arg0

ConfigRetriever

Response

\io\vertx\jphp\config\Future

the future completed when the configuration is retrieved

Registers a listener receiving configuration changes. This method cannot only be called if the configuration is broadcasted.

listen( $arg0) : void

Arguments

$arg0

callable

Registers a handler called before every scan. This method is mostly used for logging purpose.

setBeforeScanHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

the current config retriever

Registers a handler that process the configuration before being injected into @see \io\vertx\jphp\config\ConfigRetriever::getConfig or @see \io\vertx\jphp\config\ConfigRetriever::listen. This allows the code to customize the configuration.

setConfigurationProcessor( $arg0) : $this

Arguments

$arg0

callable

Response

$this

the current config retriever