scala.tools.nsc.interactive

Response

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
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. Response
  2. AnyRef
  3. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Response()

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    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()
  10. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  12. def finalize(): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  13. 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.

  14. 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)

  15. final def getClass(): java.lang.Class[_]

    Definition Classes
    AnyRef → Any
  16. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  17. def isCancelled: Boolean

    A cancel request for this response has been issued

  18. def isComplete: Boolean

    Final data set was stored

  19. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  20. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  21. final def notify(): Unit

    Definition Classes
    AnyRef
  22. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  23. def raise(exc: Throwable): Unit

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

  24. def set(x: T): Unit

    Set final data, and mark response as complete.

  25. def setProvisionally(x: T): Unit

    Set provisional data, more to come

  26. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  27. def toString(): String

    Definition Classes
    AnyRef → Any
  28. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  29. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  30. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from AnyRef

Inherited from Any