JdkAutoUpdater

ca.dvgi.periodic.jdk.JdkAutoUpdater
class JdkAutoUpdater[T](blockUntilReadyTimeout: Option[Duration], executorOverride: Option[ScheduledExecutorService]) extends AutoUpdater[Identity, Future, T]

An AutoUpdater based on the JDK's ScheduledExecutorService.

By default, a JdkAutoUpdater starts a new thread to handle its updates. If you are running many JdkAutoUpdaters, you may want to consider providing a shared ScheduledExecutorService to them.

Value parameters

blockUntilReadyTimeout

If specified, will block the calling AutoUpdatingVar instantiation until it succeeds, fails, or the timeout is reached.

executorOverride

If present, will be used instead of starting a new thread.

Attributes

Graph
Supertypes
trait AutoUpdater[Identity, Future, T]
trait AutoCloseable
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

override def close(): Unit

Attributes

Definition Classes
AutoCloseable
override def latest: Option[T]

The latest in-memory value of the variable.

The latest in-memory value of the variable.

Attributes

Returns

Some[T] if the variable has been initialized successfully, otherwise None.

Definition Classes
override def start(log: Logger, updateVar: () => T, updateInterval: UpdateInterval[T], updateAttemptStrategy: UpdateAttemptStrategy, handleInitializationError: PartialFunction[Throwable, T]): Future[Unit]

Initializes the var for the first time, handling errors as specified. If successful, schedules the next update.

Initializes the var for the first time, handling errors as specified. If successful, schedules the next update.

Value parameters

log

Implementations should use this logger for consistency.

Attributes

Returns

An effect, which, if successfully completed, signifies that a value is available. If initialization failed, the effect should also be failed.

Definition Classes