PekkoStreamsAutoUpdater

ca.dvgi.periodic.pekko.stream.PekkoStreamsAutoUpdater
See thePekkoStreamsAutoUpdater companion object
class PekkoStreamsAutoUpdater[T](blockUntilReadyTimeout: Option[Duration])(implicit actorSystem: ActorSystem) extends AutoUpdater[Future, Future, T]

An AutoUpdater based on Pekko Streams.

Recommended when Pekko is already in use, since it is completely non-blocking, does not require additional resources, and will scale to many AutoUpdatingVars without any tuning.

Value parameters

actorSystem

An ActorSystem used to update the var.

blockUntilReadyTimeout

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

Attributes

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

Members list

Value members

Concrete methods

def close(): Unit
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.

def start(log: Logger, updateVar: () => Future[T], updateInterval: UpdateInterval[T], updateAttemptStrategy: UpdateAttemptStrategy, handleInitializationError: PartialFunction[Throwable, Future[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.