new ConfigRetriever()
Defines a configuration retriever that read configuration from
Methods
close()
Closes the retriever.
configStream() → {ReadStream}
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.
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 |
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 |