ca.dvgi.periodic

Members list

Packages

Type members

Classlikes

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Custom
class Terminate

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait AttemptStrategy

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Finite
class Infinite

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
class AutoUpdatingVar[U[_], R[_], T](periodic: Periodic[U, R])(updateVar: => U[T], updateInterval: UpdateInterval[T], updateAttemptStrategy: AttemptStrategy, blockUntilReadyTimeout: Option[Duration], handleInitializationError: PartialFunction[Throwable, U[T]], updateExistingVar: Option[T => U[T]], varNameOverride: Option[String])(implicit ct: ClassTag[T]) extends AutoCloseable

A variable that updates itself. latest can be called from multiple threads, which are all guaranteed to get the latest var.

A variable that updates itself. latest can be called from multiple threads, which are all guaranteed to get the latest var.

An AutoUpdatingVar attempts to get the variable immediately upon class instantiation. If this fails, there are no further attempts (unless specified via handleInitializationError), and the effect returned by the ready method will complete unsuccesfully. If it succeeds, the effect completes successfully and latest can be safely called.

Failed updates other than the first (those that throw an exception) may be retried with various configurations.

A successful update schedules the next update, with an interval that can vary based on the just-updated var.

Value parameters

blockUntilReadyTimeout

If specified, will cause the AutoUpdatingVar constructor to block until an initial value is computed, or there is a timeout or failure. This means that the effect returned by ready will always be complete.

handleInitializationError

A PartialFunction used to recover from exceptions in the var initialization. If unspecified, the exception will fail the effect returned by ready.

periodic

A Periodic instance used to update the var

updateAttemptStrategy

Configuration for retrying updates on failure

updateExistingVar

If specified, will be used to update the var on all updates after initialization. Allows for the use of the current var when updating.

updateInterval

Configuration for the update interval

updateVar

A thunk to initialize and update the var

varNameOverride

A name for this variable, used in logging. If unspecified, the simple class name of T will be used.

Attributes

Companion
object
Supertypes
trait AutoCloseable
class Object
trait Matchable
class Any

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
class FnRunner[F[_], R[_]](periodic: Periodic[F, R])(fn: => F[FiniteDuration], fnAttemptStrategy: AttemptStrategy, fnName: String, initialDelay: FiniteDuration) extends AutoCloseable

A FnRunner executes a side-effecting function periodically. The FiniteDuration returned from the function determines the delay before the next run.

A FnRunner executes a side-effecting function periodically. The FiniteDuration returned from the function determines the delay before the next run.

Failed runs may be retried with various configurations.

Value parameters

fn

The side-effecting function to run periodically

fnAttemptStrategy

Configuration for retrying runs on failure

fnName

A human-friendly description of the function, used in logging

initialDelay

If specified, the first run of the function will be delayed this much

periodic

A Periodic instance used to run the function

Attributes

Companion
object
Supertypes
trait AutoCloseable
class Object
trait Matchable
class Any
object FnRunner

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
FnRunner.type
trait Periodic[F[_], R[_]] extends AutoCloseable

Attributes

Supertypes
trait AutoCloseable
class Object
trait Matchable
class Any
Known subtypes
class JdkPeriodic[F]
case object UnreadyAutoUpdatingVarException extends IllegalStateException

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Product
trait Equals
class IllegalStateException
class RuntimeException
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
Self type
sealed trait UpdateInterval[-T]

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Dynamic[T]
class Static

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type