Operation

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

Companion:
object
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

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

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

Inherited methods

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