Class PerspectivePollingFuture<V>


  • public class PerspectivePollingFuture<V>
    extends PollingFuture<V>
    Manages a polling task that looks up its rate from a property tree and is reactive to the rate changing.
    • Constructor Detail

      • PerspectivePollingFuture

        public PerspectivePollingFuture​(PerspectiveContext context,
                                        PropertyTree props,
                                        java.lang.String refreshRatePath,
                                        long defaultRate,
                                        java.util.function.Supplier<java.util.concurrent.CompletableFuture<V>> fetch,
                                        java.util.function.BiConsumer<V,​java.lang.Throwable> consumer,
                                        java.lang.String diagnosticId)
      • PerspectivePollingFuture

        public PerspectivePollingFuture​(java.util.concurrent.ScheduledExecutorService scheduler,
                                        java.util.concurrent.ExecutorService executor,
                                        PropertyTree props,
                                        java.lang.String refreshRatePath,
                                        long defaultRate,
                                        java.util.function.Supplier<java.util.concurrent.CompletableFuture<V>> fetch,
                                        java.util.function.BiConsumer<V,​java.lang.Throwable> consumer,
                                        java.lang.String diagnosticId)
    • Method Detail

      • getInitialRate

        protected long getInitialRate()
        Description copied from class: PollingFuture
        Default implementation returns the rate from the constructor, but provides a place for subclasses to re-define the rate on startup if necessary.
        Overrides:
        getInitialRate in class PollingFuture<V>
      • getRefreshRateFromProps

        protected long getRefreshRateFromProps()
      • parseLong

        protected java.util.Optional<java.lang.Long> parseLong​(QualifiedValue qv)