implicit final class Ops[+A] extends AnyVal
Extension methods for FutureUnlessShutdown
- Alphabetic
- By Inheritance
- Ops
- AnyVal
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Ops(self: FutureUnlessShutdown[A])
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- Any
- final def ##: Int
- Definition Classes
- Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- Any
- def asGrpcFuture(implicit ec: ExecutionContext, errorLoggingContext: ErrorLoggingContext): Future[A]
Converts a com.digitalasset.canton.lifecycle.FutureUnlessShutdown into a scala.concurrent.Future by encoding the shutdown error into a com.digitalasset.canton.networking.grpc.CantonGrpcUtil.GrpcErrors.AbortedDueToShutdown gRPC self-service error.
Converts a com.digitalasset.canton.lifecycle.FutureUnlessShutdown into a scala.concurrent.Future by encoding the shutdown error into a com.digitalasset.canton.networking.grpc.CantonGrpcUtil.GrpcErrors.AbortedDueToShutdown gRPC self-service error.
Consider using this method for generally handling com.digitalasset.canton.lifecycle.FutureUnlessShutdown in gRPC services.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def failOnShutdownTo(t: => Throwable)(implicit ec: ExecutionContext): Future[A]
consider using failOnShutdownToAbortException unless you need a specific exception.
- def failOnShutdownToAbortException(action: String)(implicit ec: ExecutionContext): Future[A]
Converts com.digitalasset.canton.lifecycle.UnlessShutdown.AbortedDueToShutdowns into an internal exception so that shutdowns can tunnel through APIs that expect a plain scala.concurrent.Future Must be used together with com.digitalasset.canton.lifecycle.FutureUnlessShutdown.recoverFromAbortException to turn the internal exception back into com.digitalasset.canton.lifecycle.UnlessShutdown.AbortedDueToShutdown.
- def failed(implicit ec: ExecutionContext): FutureUnlessShutdown[Throwable]
Analog to scala.concurrent.Future.
failed
- def flatMap[B](f: (A) => FutureUnlessShutdown[B])(implicit ec: ExecutionContext): FutureUnlessShutdown[B]
- def flatten[S](implicit ec: ExecutionContext, ev: <:<[A, FutureUnlessShutdown[S]]): FutureUnlessShutdown[S]
- def getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
- def isCompleted: Boolean
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def map[B](f: (A) => B)(implicit ec: ExecutionContext): FutureUnlessShutdown[B]
- def onComplete[B](f: (Try[UnlessShutdown[A]]) => Unit)(implicit ec: ExecutionContext): Unit
Analog to scala.concurrent.Future.onComplete
- def onShutdown[B >: A](f: => B)(implicit ec: ExecutionContext): Future[B]
Evaluates
f
and returns its result as a Future if this future completes with UnlessShutdown.AbortedDueToShutdown. - def recover[U >: A](pf: PartialFunction[Throwable, UnlessShutdown[U]])(implicit executor: ExecutionContext): FutureUnlessShutdown[U]
Analog to scala.concurrent.Future.recover
- def subflatMap[B](f: (A) => UnlessShutdown[B])(implicit ec: ExecutionContext): FutureUnlessShutdown[B]
- def tapOnShutdown(f: => Unit)(implicit ec: ExecutionContext, errorLoggingContext: ErrorLoggingContext): FutureUnlessShutdown[A]
Evaluates
f
on shutdown but retains the result of the future. - def toString(): String
- Definition Classes
- Any
- def transform[B](success: (UnlessShutdown[A]) => UnlessShutdown[B], failure: (Throwable) => Throwable)(implicit ec: ExecutionContext): FutureUnlessShutdown[B]
Analog to scala.concurrent.Future.
transform
- def transform[B](f: (Try[UnlessShutdown[A]]) => Try[UnlessShutdown[B]])(implicit ec: ExecutionContext): FutureUnlessShutdown[B]
Analog to scala.concurrent.Future.
transform
- def transformIntoSuccess[B](f: (Try[UnlessShutdown[A]]) => UnlessShutdown[B])(implicit ec: ExecutionContext): FutureUnlessShutdown[B]
- def transformOnShutdown[B >: A](onShutdownOutcome: => B)(implicit ec: ExecutionContext): FutureUnlessShutdown[B]
- def transformWith[B](f: (Try[UnlessShutdown[A]]) => FutureUnlessShutdown[B])(implicit ec: ExecutionContext): FutureUnlessShutdown[B]
Analog to scala.concurrent.Future.transformWith
- def transformWithHandledAborted[B](f: (Try[A]) => FutureUnlessShutdown[B])(implicit ec: ExecutionContext): FutureUnlessShutdown[B]
Similar to transformWith, but more interchangeable with normal scala.concurrent.Future.transformWith
- def unwrap: Future[UnlessShutdown[A]]
Open the type abstraction
- def withFilter(p: (A) => Boolean)(implicit executor: ExecutionContext): FutureUnlessShutdown[A]
Used by for-comprehensions.