Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ConfigRetriever

Defines a configuration retriever that read configuration from

and tracks changes periodically.

Hierarchy

  • ConfigRetriever

Index

Methods

close

  • close(): void
  • Closes the retriever.

    Returns void

configStream

  • configStream(): ReadStream<{}>
  • Returns ReadStream<{}>

getCachedConfig

  • getCachedConfig(): {}
  • Gets the last computed configuration.

    Returns {}

    • [key: string]: any

getConfig

  • getConfig(): PromiseLike<{}>
  • getConfig(completionHandler: ((res: AsyncResult<{}>) => void) | Handler<AsyncResult<{}>>): void
  • Reads the configuration from the different and computes the final configuration.

    Returns PromiseLike<{}>

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

    Parameters

    • completionHandler: ((res: AsyncResult<{}>) => void) | Handler<AsyncResult<{}>>

    Returns void

listen

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

    Parameters

    Returns void

setBeforeScanHandler

  • setBeforeScanHandler(handler: ((res: void) => void) | Handler<void>): ConfigRetriever
  • Registers a handler called before every scan. This method is mostly used for logging purpose.

    Parameters

    • handler: ((res: void) => void) | Handler<void>

    Returns ConfigRetriever

setConfigurationProcessor

  • Registers a handler that process the configuration before being injected into {@link ConfigRetriever#getConfig} or {@link ConfigRetriever#listen}. This allows the code to customize the configuration.

    Parameters

    • processor: (arg: {}) => {}
        • (arg: {}): {}
        • Parameters

          • arg: {}
            • [key: string]: any

          Returns {}

          • [key: string]: any

    Returns ConfigRetriever

Static create

  • Creates an instance of the default implementation of the ConfigRetriever.

    Parameters

    Returns ConfigRetriever

  • Creates an instance of the default implementation of the ConfigRetriever, using the default settings (json file, system properties and environment variables).

    Parameters

    • vertx: Vertx

    Returns ConfigRetriever

Generated using TypeDoc