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. def != (arg0: AnyRef): Boolean

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

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

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

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

    Attributes
    final
    Definition Classes
    Any
  6. def asInstanceOf [T0] : T0

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

    Attributes
    final
    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. def getClass (): java.lang.Class[_]

    Attributes
    final
    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. def isInstanceOf [T0] : Boolean

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

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

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

    Attributes
    final
    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. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  27. def toString (): String

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

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

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

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from AnyRef

Inherited from Any