Action

org.specs2.control.Action
See theAction companion object
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

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

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

add a finalizer

add a finalizer

Attributes

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

catch any exception resulting from running the action later

catch any exception resulting from running the action later

Attributes

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

Attributes

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

Attributes

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!!!

Attributes

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

Attributes

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

Attributes

def runVoid(ee: ExecutionEnv): Unit

run the action for its side effects

run the action for its side effects

Attributes

def thenFinally(last: Finalizer): Action[A]

add a finalizer

add a finalizer

Attributes

run the action and throw any exception

run the action and throw any exception

Attributes

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

synonym for orElse

synonym for orElse

Attributes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product