Packages

class Response[T] extends AnyRef

Typical interaction, given a predicate <user-input>, a function <display>, and an exception handler <handle>:

val TIMEOUT = 100 // (milliseconds) or something like that val r = new Response() while (!r.isComplete && !r.isCancelled) { if (<user-input>) r.cancel() else r.get(TIMEOUT) match { case Some(Left(data)) => <display>(data) case Some(Right(exc)) => <handle>(exc) case None => } }

Source
Response.scala
Linear Supertypes
AnyRef, Any
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Response
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new Response()

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from Response[T] toany2stringadd[Response[T]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (Response[T], B)
    Implicit
    This member is added by an implicit conversion from Response[T] toArrowAssoc[Response[T]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def cancel(): Unit

    Cancel action computing this response (Only the party that calls get on a response may cancel).

  8. def clear(): Unit
  9. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  10. def ensuring(cond: (Response[T]) => Boolean, msg: => Any): Response[T]
    Implicit
    This member is added by an implicit conversion from Response[T] toEnsuring[Response[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: (Response[T]) => Boolean): Response[T]
    Implicit
    This member is added by an implicit conversion from Response[T] toEnsuring[Response[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. def ensuring(cond: Boolean, msg: => Any): Response[T]
    Implicit
    This member is added by an implicit conversion from Response[T] toEnsuring[Response[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  13. def ensuring(cond: Boolean): Response[T]
    Implicit
    This member is added by an implicit conversion from Response[T] toEnsuring[Response[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  14. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  16. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  17. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from Response[T] toStringFormat[Response[T]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  18. def get(timeout: Long): Option[Either[T, Throwable]]

    Optionally get data within timeout milliseconds.

    Optionally get data within timeout milliseconds. When interrupted will return with Some(Right(InterruptedException)) When timeout ends, will return last stored provisional result, or else None if no provisional result was stored.

  19. def get: Either[T, Throwable]

    Get final data, wait as long as necessary.

    Get final data, wait as long as necessary. When interrupted will return with Right(InterruptedException)

  20. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  21. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  22. def isCancelled: Boolean

    A cancel request for this response has been issued

  23. def isComplete: Boolean

    Final data set was stored

  24. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  25. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  26. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  27. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  28. def raise(exc: Throwable): Unit

    Store raised exception in data, and mark response as complete.

  29. def set(x: T): Unit

    Set final data, and mark response as complete.

  30. def setProvisionally(x: T): Unit

    Set provisional data, more to come

  31. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  32. def toString(): String
    Definition Classes
    AnyRef → Any
  33. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  34. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  35. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Deprecated Value Members

  1. def [B](y: B): (Response[T], B)
    Implicit
    This member is added by an implicit conversion from Response[T] toArrowAssoc[Response[T]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Use -> instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd fromResponse[T] to any2stringadd[Response[T]]

Inherited by implicit conversion StringFormat fromResponse[T] to StringFormat[Response[T]]

Inherited by implicit conversion Ensuring fromResponse[T] to Ensuring[Response[T]]

Inherited by implicit conversion ArrowAssoc fromResponse[T] to ArrowAssoc[Response[T]]

Ungrouped