Operation

org.specs2.control.Operation
See theOperation companion object
case class Operation[A](operation: () => Either[Throwable, A], last: Vector[Finalizer])

Synchronous action with:

  • an optional list of "finalization" actions to be executed when this action is done if it throws an exception. This allows resources to be safely disposed of

It is essentially the same as an Action without the asynchronicity

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): Operation[A]
def attempt: Operation[Either[Throwable, A]]
def flatMap[B](f: A => Operation[B]): Operation[B]
def map[B](f: A => B): Operation[B]
def orElse(other: Operation[A]): Operation[A]
def recover(f: Throwable => Operation[A]): Operation[A]
def recoverWith(f: Throwable => A): Operation[A]
def runMonoid(using m: Monoid[A]): A
def runOperation: Either[Throwable, A]

run this operation, to get back a result (possibly an exception) and run the finalizers when the operation has been executed

run this operation, to get back a result (possibly an exception) and run the finalizers when the operation has been executed

Attributes

def runOption: Option[A]
def runVoid: Unit
def thenFinally(operation: Operation[A]): Operation[A]
def toAction: Action[A]
def unsafeRun: A
def |||(other: Operation[A]): Operation[A]

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product