Packages

final class ReferenceOps[T] extends AnyVal

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

Instance Constructors

  1. new ReferenceOps(value: async.Future[T])

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 asIO: async.IO[T]

    !!! USE WITH CARE !!! Most likely you want to use FutureOps.suspendInIO which ensures that it suspends the side effects of the given future (if it created by the given expression, if it's a val, then good luck).

    !!! USE WITH CARE !!! Most likely you want to use FutureOps.suspendInIO which ensures that it suspends the side effects of the given future (if it created by the given expression, if it's a val, then good luck).

    Having to care about such val/def distinctions shows why Future is an imperative programming mess.

    Annotations
    @inline()
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def asTask: async.Task[T]

    !!! USE WITH CARE !!! Most likely you want to use FutureOps.suspendInTask which ensures that it suspends the side effects of the given future (if it created by the given expression, if it's a val, then good luck).

    !!! USE WITH CARE !!! Most likely you want to use FutureOps.suspendInTask which ensures that it suspends the side effects of the given future (if it created by the given expression, if it's a val, then good luck).

    Having to care about such val/def distinctions shows why Future is an imperative programming mess.

    Annotations
    @inline()
  7. def attempResult(implicit ec: async.ExecutionContext): async.Future[sync.Result[T]]

    Makes the failure, and non-failure part of this effect explicit in a busymachines.effects.sync.Result type.

    Makes the failure, and non-failure part of this effect explicit in a busymachines.effects.sync.Result type.

    This transforms any failed effect, into a pure one with and busymachines.effects.sync.Incorrect value.

    Annotations
    @inline()
  8. def bimap[R](result: (sync.Result[T]) ⇒ sync.Result[R])(implicit ec: async.ExecutionContext): async.Future[R]

    Similar to the overload, but the busymachines.effects.sync.Correct branch of the result is used to change the "pure" branch of this effect, and busymachines.effects.sync.Incorrect branch is used to change the "fail" branch of the effect.

    Similar to the overload, but the busymachines.effects.sync.Correct branch of the result is used to change the "pure" branch of this effect, and busymachines.effects.sync.Incorrect branch is used to change the "fail" branch of the effect.

    Annotations
    @inline()
  9. def bimap[R](good: (T) ⇒ R, bad: (Throwable) ⇒ Anomaly)(implicit ec: async.ExecutionContext): async.Future[R]

    Used to transform both the "pure" part of the effect, and the "fail" part.

    Used to transform both the "pure" part of the effect, and the "fail" part. Hence the name "bi" map, because it also allows you to change both branches of the effect, not just the happy path.

    Annotations
    @inline()
  10. def bimapThr[R](good: (T) ⇒ R, bad: (Throwable) ⇒ Throwable)(implicit ec: async.ExecutionContext): async.Future[R]

    Similar to the overload, but the busymachines.effects.sync.Correct branch of the result is used to change the "pure" branch of this effect, and busymachines.effects.sync.Incorrect branch is used to change the "fail" branch of the effect.

    Similar to the overload, but the busymachines.effects.sync.Correct branch of the result is used to change the "pure" branch of this effect, and busymachines.effects.sync.Incorrect branch is used to change the "fail" branch of the effect.

    The overload that uses java.lang.Throwable instead of busymachines.core.Anomaly

    Annotations
    @inline()
  11. def discardContent(implicit ec: async.ExecutionContext): async.Future[Unit]

    Explicitely discard the contents of this effect, and return Unit instead.

    Explicitely discard the contents of this effect, and return Unit instead.

    N.B. computation, and side-effects captured within this effect are still executed, it's just the final value that is discarded

    Annotations
    @inline()
  12. def getClass(): Class[_ <: AnyVal]
    Definition Classes
    AnyVal → Any
  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. def morph[R](result: (sync.Result[T]) ⇒ R)(implicit ec: async.ExecutionContext): async.Future[R]

    Semantically equivalent to the overload morph that accepts two functions, but those encoded as the corresponding branches of a Result type.

    Semantically equivalent to the overload morph that accepts two functions, but those encoded as the corresponding branches of a Result type.

    Undefined behavior if you throw exceptions in the method. DO NOT do that!

    Annotations
    @inline()
  15. def morph[R](good: (T) ⇒ R, bad: (Throwable) ⇒ R)(implicit ec: async.ExecutionContext): async.Future[R]

    Given the basic two-pronged nature of this effect.

    Given the basic two-pronged nature of this effect. the good function transforms the underlying "pure" (correct, successful, etc) if that's the case. the bad function transforms the underlying "failure" part of the effect into a "pure" part.

    Therefore, by using morph you are defining the rules by which to make the effect into a successful one that does not short-circuit monadic flatMap chains.

    e.g:

    val f: Future[Int] = Future.fail(InvalidInputFailure)
    Future.morph(f, (i: Int) => i *2, (t: Throwable) => 42)

    Undefined behavior if you throw exceptions in the method. DO NOT do that!

    Annotations
    @inline()
  16. def toString(): String
    Definition Classes
    Any
  17. def unsafeSyncGet(atMost: duration.FiniteDuration = ...): T

    !!! USE WITH CARE !!!

    !!! USE WITH CARE !!!

    Mostly here for testing. There is almost no reason whatsover for you to explicitely call this in your code. You have libraries that do this for you "at the end of the world" parts of your program: e.g. akka-http when waiting for the response value to a request.

    Annotations
    @inline()
  18. val value: async.Future[T]

Inherited from AnyVal

Inherited from Any

Ungrouped