Packages

  • package root
    Definition Classes
    root
  • package com
    Definition Classes
    root
  • package daml
    Definition Classes
    com
  • package concurrent

    A compatible layer for scala.concurrent with extra type parameters to control ExecutionContexts.

    A compatible layer for scala.concurrent with extra type parameters to control ExecutionContexts. Deliberately uses the same names as the equivalent concepts in scala.concurrent.

    The trouble with sc.ExecutionContext is that it is used incoherently. This leads to the problems described in https://failex.blogspot.com/2020/05/global-typeclass-coherence-principles-3.html . The extension layer in this package adds a phantom type parameter to ExecutionContext and related types, so that types can be used to discriminate between ExecutionContexts at compile-time, and so Futures can declare which ExecutionContext their operations are in.

    For Scala 2.12, you must pass -Xsource:2.13 to scalac for methods and conversions to be automatically found. You must also import scalaz.syntax.bind._ or similar for Future methods like map, flatMap, and so on.

    There are no constraints on the EC type variable; you need only declare types you wish to use for it that are sufficient for describing the domains in which you want ExecutionContexts to be discriminated. These types will never be instantiated, so you can simply declare that they exist. They can be totally separate, or have subtyping relationships; any subtyping relationships they have will be reflected in equivalent subtyping relationships between the resulting ExecutionContexts; if you declare sealed trait Elephant extends Animal, then automatically ExecutionContext[Elephant] <: ExecutionContext[Animal] with scalac preferring the former when available (because it is "more specific"). They can even be singleton types, so you might use x.type to suggest that the context is associated with the exact value of the x variable.

    If you want to, say, refer to both sc.Future and concurrent.Future in the same file, we recommend importing *the containing package* with an alias rather than renaming each individual class you import. For example,

    import com.daml.concurrent._
    import scala.{concurrent => sc}
    // OR
    import scala.concurrent._
    import com.daml.{concurrent => dc}

    The exact name isn't important, but you should pick a short one that is sufficiently suggestive for you.

    You should always be able to remove the substring Of.Instance.T from any inferred type; we strongly suggest doing this for clarity.

    Demonstrations of the typing behavior can be found in FutureSpec and ExecutionContextSpec. This library has no interesting runtime characteristics; you should think of it as exactly like scala.concurrent in that regard.

    Definition Classes
    daml
  • object FutureOf

    Instances and methods for FutureOf.

    Instances and methods for FutureOf. You should not import these; instead, enable -Xsource:2.13 and they will always be available without import.

    Definition Classes
    concurrent
  • AnyOps
  • NonEcOps
  • Ops

implicit final class Ops[-EC, +A] extends AnyVal

Common methods like map and flatMap are not provided directly; instead, import the appropriate Scalaz syntax for these; scalaz.syntax.bind._ will give you map, flatMap, and most other common choices. Only exotic Future-specific combinators are provided here.

Linear Supertypes
AnyVal, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Ops
  2. AnyVal
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new Ops(self: Future[EC, A])

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    Any
  2. final def ##: Int
    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    Any
  4. def andThen[U](pf: PartialFunction[Try[A], U])(implicit ec: ExecutionContext[EC]): Future[EC, A]
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def collect[B](pf: PartialFunction[A, B])(implicit ec: ExecutionContext[EC]): Future[EC, B]
  7. def failed: Future[EC, Throwable]
  8. def fallbackTo[LEC <: EC, B >: A](that: Future[LEC, B]): Future[LEC, B]
  9. def filter(p: (A) => Boolean)(implicit ec: ExecutionContext[EC]): Future[EC, A]
  10. def foreach[U](f: (A) => U)(implicit ec: ExecutionContext[EC]): Unit
  11. def getClass(): Class[_ <: AnyVal]
    Definition Classes
    AnyVal → Any
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. def onComplete[U](f: (Try[A]) => U)(implicit ec: ExecutionContext[EC]): Unit
  14. def recover[B >: A](pf: PartialFunction[Throwable, B])(implicit ec: ExecutionContext[EC]): Future[EC, B]
  15. def recoverWith[LEC <: EC, B >: A](pf: PartialFunction[Throwable, Future[LEC, B]])(implicit ec: ExecutionContext[EC]): Future[EC, B]
  16. def require[NEC <: EC]: Future[NEC, A]

    .require[NEC] is a friendly alias for : Future[NEC, A].

  17. def toString(): String
    Definition Classes
    Any
  18. def transform[B](s: (A) => B, f: (Throwable) => Throwable)(implicit ec: ExecutionContext[EC]): Future[EC, B]
  19. def transform[B](f: (Try[A]) => Try[B])(implicit ec: ExecutionContext[EC]): Future[EC, B]
  20. def transformWith[LEC <: EC, B](f: (Try[A]) => Future[LEC, B])(implicit ec: ExecutionContext[EC]): Future[LEC, B]
  21. def withFilter(p: (A) => Boolean)(implicit ec: ExecutionContext[EC]): Future[EC, A]
  22. def zip[LEC <: EC, B](that: Future[LEC, B]): Future[LEC, (A, B)]
  23. def zipWith[LEC <: EC, B, C](that: Future[LEC, B])(f: (A, B) => C)(implicit ec: ExecutionContext[LEC]): Future[LEC, C]

Inherited from AnyVal

Inherited from Any

Ungrouped