Packages

class FutureUnlessShutdownThereafter extends ThereafterAsync[FutureUnlessShutdown]

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. FutureUnlessShutdownThereafter
  2. ThereafterAsync
  3. Thereafter
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new FutureUnlessShutdownThereafter()(implicit ec: ExecutionContext)

Type Members

  1. type Content[A] = Try[UnlessShutdown[A]]

    The container type for computation result.

    The container type for computation result.

    Must contain at most one element of the given type parameter.

    Definition Classes
    FutureUnlessShutdownThereafterThereafter
  2. type Shape = Unit

    Defines the shapes under which a Content does contain a single element of the type argument.

    Defines the shapes under which a Content does contain a single element of the type argument. With withShape(shape, x), we can uniquely reconstruct the Content from a value x and its shape, which is needed for implementing thereafter in terms of transformChaining.

    For example, if Content is Either[String, *], then only the form Right(x) contains such an element x. So they are all of the same shape Right and so the shape can be any singleton type such as Right.type or Unit. Conversely, if Content is Tuple2(Int, *), then an element x can appear in many values, e.g., (0, x) and (1, x) of different shapes. In this case, the shape type would be Int so that we can reconstruct (0, x) or (1, x) from the value x and the corresponding shape 0 or 1.

    Formally, Shape is the type of one-hole contexts for Content, also known as zippers, which is the derivative of Content/ As such, Shape should depend on its type argument. However, as Content contains at most element of the given argument type, its derivative is always constant. So we can omit the type argument altogether.

    Definition Classes
    FutureUnlessShutdownThereafterThereafter
    See also

    https://en.wikipedia.org/wiki/Zipper_(data_structure)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  6. def covariantContent[A, B](implicit ev: <:<[A, B]): <:<[Content[A], Content[B]]

    Evidences that Content is actually covariant in its type argument.

    Evidences that Content is actually covariant in its type argument.

    We do not declare Content itself as covariant in the type definition because this would leak into the Thereafter.Aux pattern and thereby break the compiler's type inference.

    Definition Classes
    FutureUnlessShutdownThereafterThereafter
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  9. def executionContext: ExecutionContext
  10. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  11. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  15. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  16. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  17. def thereafter[A](f: FutureUnlessShutdown[A])(body: (Content[A]) => Unit): FutureUnlessShutdown[A]

    Runs body after the computation f has completed.

    Runs body after the computation f has completed.

    returns

    The computation that results from chaining f before body. Completes only after body has run. If body completes normally, the result of the computation is the same as f's result. If body throws, the result includes the thrown exception.

    Definition Classes
    Thereafter
  18. def thereafterF[A](f: FutureUnlessShutdown[A])(body: (Content[A]) => Future[Unit]): FutureUnlessShutdown[A]

    runs body after the computation f has completed

    runs body after the computation f has completed

    returns

    The computation that results from chaining f before body. Completes only after body has run. If body completes normally, the result of the computation is the same as f's result. If body throws, the result includes the thrown exception. If body produces a failed computation, the result includes the thrown exception.

    Definition Classes
    ThereafterAsync
  19. def thereafterFSuccessOrFailure[A](f: FutureUnlessShutdown[A])(success: (A) => Future[Unit], failure: => Future[Unit]): FutureUnlessShutdown[A]
    Definition Classes
    ThereafterAsync
  20. def thereafterP[A](f: FutureUnlessShutdown[A])(body: PartialFunction[Content[A], Unit]): FutureUnlessShutdown[A]
    Definition Classes
    Thereafter
  21. def thereafterSuccessOrFailure[A](f: FutureUnlessShutdown[A])(success: (A) => Unit, failure: => Unit): FutureUnlessShutdown[A]
    Definition Classes
    Thereafter
  22. def toString(): String
    Definition Classes
    AnyRef → Any
  23. def transformChaining[A](f: FutureUnlessShutdown[A])(empty: (FutureUnlessShutdownThereafterContent[Uninhabited]) => Unit, single: (Shape, A) => A): FutureUnlessShutdown[A]

    Runs either empty or single after the computation f has run.

    Runs either empty or single after the computation f has run.

    • If f does not produce a value of type A, empty is run. If empty completes normally, f is returned. If empty throws, the thrown exception is incorporated into f as follows:
      • If f did not throw an exception, the exception overrides the result of f.
      • If f did throw an exception, the exception from empty is added as a suppressed exception.
    • Otherwise, if f produces a single value a of type A, then the behavior is equivalent to f.map(single).

    This method is more general than thereafter because single can transform the value. This is necessary for instances such as cats.data.Nested where the nested computation must be transformed, which is not possible with thereafter for the outer computation. Note that a plain functor on the outer computation does not suffice because the transformation of the inner computation could throw and it is not guaranteed that the functor properly chains the exceptions. Nested computations are useful for keeping the several computations distinguishable, such as the synchronous and asynchronous parts of message processing.

    The signature of single separates the Shape from the value to ensure that single only transforms the value, but does not change the shape. This is crucial for cats.data.Nested as we would otherwise have to be able to replace the inner computation with an empty content of the outer, which doesn't make sense.

    Definition Classes
    FutureUnlessShutdownThereafterThereafter
  24. def transformChainingF[A](f: FutureUnlessShutdown[A])(empty: (FutureUnlessShutdownThereafterContent[Uninhabited]) => Future[Unit], single: (Unit, A) => Future[A]): FutureUnlessShutdown[A]
  25. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  26. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  27. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  28. def withShape[A](shape: Unit, x: A): FutureUnlessShutdownThereafterContent[A]

    Plugs the value x into the hole of the shape interpreted as a one-hole context.

    Plugs the value x into the hole of the shape interpreted as a one-hole context.

    Definition Classes
    FutureUnlessShutdownThereafterThereafter

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from AnyRef

Inherited from Any

Ungrouped