Action

case class Action[A](runNow: ExecutionEnv => Future[A], last: Vector[Finalizer])

Asynchronous action with:

  • an optional list of "finalization" actions to be executed when this action is done whether it has timed-out or thrown an exception. This allows resources to be safely disposed of
Companion:
object
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Value members

Concrete methods

def addLast(finalizer: Finalizer): Action[A]

add a finalizer

add a finalizer

def attempt: Action[Either[Throwable, A]]

catch any exception resulting from running the action later

catch any exception resulting from running the action later

def flatMap[B](f: A => Action[B]): Action[B]
def map[B](f: A => B): Action[B]
def orElse(other: Action[A]): Action[A]

run another action if this one fails

run another action if this one fails

def run(ee: ExecutionEnv): A
def runAction(ee: ExecutionEnv, timeout: Option[FiniteDuration]): Either[Throwable, A]

Run the action and return an exception if it fails Whatever happens run the finalizers

Run the action and return an exception if it fails Whatever happens run the finalizers

def runFuture(ee: ExecutionEnv, timeout: Option[FiniteDuration]): Future[A]

run as a Future and raise a timeout exception if necessary NOTE: this does not execute the finalizers!!!

run as a Future and raise a timeout exception if necessary NOTE: this does not execute the finalizers!!!

def runMonoid(ee: ExecutionEnv)(using m: Monoid[A]): A

run the action and the return an empty value in case of an error

run the action and the return an empty value in case of an error

def runOption(ee: ExecutionEnv): Option[A]

run the action and return Nothing is case of an error

run the action and return Nothing is case of an error

def runVoid(ee: ExecutionEnv): Unit

run the action for its side effects

run the action for its side effects

add a finalizer

add a finalizer

run the action and throw any exception

run the action and throw any exception

def |||(other: Action[A]): Action[A]

synonym for orElse

synonym for orElse

Inherited methods

def productElementNames: Iterator[String]
Inherited from:
Product
def productIterator: Iterator[Any]
Inherited from:
Product