Class: ConfigRetriever

vertx-config-js/config_retriever~ ConfigRetriever

new ConfigRetriever()

Defines a configuration retriever that read configuration from
Source:

Methods

close()

Closes the retriever.
Source:

configStream() → {ReadStream}

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

getCachedConfig() → {Object}

Gets the last computed configuration.
Source:
Returns:
the last configuration
Type
Object

getConfig(completionHandler)

Reads the configuration from the different and computes the final configuration.
Parameters:
Name Type Description
completionHandler function handler receiving the computed configuration, or a failure if the configuration cannot be retrieved
Source:

listen(listener)

Registers a listener receiving configuration changes. This method cannot only be called if the configuration is broadcasted.
Parameters:
Name Type Description
listener function the listener
Source:

setBeforeScanHandler(handler) → {ConfigRetriever}

Registers a handler called before every scan. This method is mostly used for logging purpose.
Parameters:
Name Type Description
handler function the handler, must not be null
Source:
Returns:
the current config retriever
Type
ConfigRetriever

setConfigurationProcessor(processor) → {ConfigRetriever}

Registers a handler that process the configuration before being injected into ConfigRetriever#getConfig or ConfigRetriever#listen. This allows the code to customize the configuration.
Parameters:
Name Type Description
processor function the processor, must not be null. The method must not return null. The returned configuration is used. If the processor does not update the configuration, it must return the input configuration. If the processor throws an exception, the failure is passed to the ConfigRetriever#getConfig handler.
Source:
Returns:
the current config retriever
Type
ConfigRetriever