Class GlobalRefresher
- java.lang.Object
-
- com.couchbase.client.core.config.refresher.GlobalRefresher
-
public class GlobalRefresher extends Object
TheGlobalRefresher
keeps the cluster-level global config up-to-date.It works very similar to the
KeyValueBucketRefresher
, but explicitly has no bucket level scope. It can be started and stopped, since there might be situations where global config polling is not needed.
-
-
Constructor Summary
Constructors Constructor Description GlobalRefresher(ConfigurationProvider provider, Core core)
Creates a new global refresher.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Duration
pollerInterval()
Allows to override the default poller interval in tests to speed them up.Mono<Void>
shutdown()
Permanently shuts down thisGlobalRefresher
.Mono<Void>
start()
Starts theGlobalRefresher
.Mono<Void>
stop()
Stops theGlobalRefresher
.
-
-
-
Constructor Detail
-
GlobalRefresher
public GlobalRefresher(ConfigurationProvider provider, Core core)
Creates a new global refresher.- Parameters:
provider
- the config provider which should get the config updates proposed.core
- the core to send the config commands to.
-
-
Method Detail
-
pollerInterval
protected Duration pollerInterval()
Allows to override the default poller interval in tests to speed them up.- Returns:
- the poller interval as a duration.
-
start
public Mono<Void> start()
Starts theGlobalRefresher
.Refreshing can be started and stopped multiple times until the non-reversible
shutdown()
is called.- Returns:
- a
Mono
completing when started.
-
stop
public Mono<Void> stop()
Stops theGlobalRefresher
.Refreshing can be started and stopped multiple times until the non-reversible
shutdown()
is called.- Returns:
- a
Mono
completing when stopped.
-
shutdown
public Mono<Void> shutdown()
Permanently shuts down thisGlobalRefresher
.- Returns:
- a
Mono
completing when shutdown completed.
-
-