Class PerspectivePollingFuture<V>
java.lang.Object
com.inductiveautomation.ignition.common.lifecycle.AbstractLifecycle
com.inductiveautomation.ignition.common.execution.PollingFuture<V>
com.inductiveautomation.perspective.gateway.threading.PerspectivePollingFuture<V>
Manages a polling task that looks up its rate from a property tree and is reactive to the rate changing.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.inductiveautomation.ignition.common.execution.PollingFuture
PollingFuture.State
-
Field Summary
Fields inherited from class com.inductiveautomation.ignition.common.execution.PollingFuture
LOG
-
Constructor Summary
ConstructorsConstructorDescriptionPerspectivePollingFuture
(PerspectiveContext context, PropertyTree props, String refreshRatePath, long defaultRate, Supplier<CompletableFuture<V>> fetch, BiConsumer<V, Throwable> consumer, String diagnosticId) PerspectivePollingFuture
(ScheduledExecutorService scheduler, ExecutorService executor, PropertyTree props, String refreshRatePath, long defaultRate, Supplier<CompletableFuture<V>> fetch, BiConsumer<V, Throwable> consumer, String diagnosticId) -
Method Summary
Modifier and TypeMethodDescriptionprotected long
Default implementation returns the rate from the constructor, but provides a place for subclasses to re-define the rate on startup if necessary.protected long
protected void
protected void
Methods inherited from class com.inductiveautomation.ignition.common.execution.PollingFuture
getRateMillis, onStartup, setRate, submitIfIdle
Methods inherited from class com.inductiveautomation.ignition.common.lifecycle.AbstractLifecycle
isRunning, shutdown, startup
-
Constructor Details
-
PerspectivePollingFuture
public PerspectivePollingFuture(PerspectiveContext context, PropertyTree props, String refreshRatePath, long defaultRate, Supplier<CompletableFuture<V>> fetch, BiConsumer<V, Throwable> consumer, String diagnosticId) -
PerspectivePollingFuture
public PerspectivePollingFuture(ScheduledExecutorService scheduler, ExecutorService executor, PropertyTree props, String refreshRatePath, long defaultRate, Supplier<CompletableFuture<V>> fetch, BiConsumer<V, Throwable> consumer, String diagnosticId)
-
-
Method Details
-
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 classPollingFuture<V>
-
onShutdown
protected void onShutdown()- Overrides:
onShutdown
in classPollingFuture<V>
-
onRefreshRateChange
-
getRefreshRateFromProps
protected long getRefreshRateFromProps() -
parseLong
-