StdInConcurrentReader

scala.build.internal.StdInConcurrentReader$

Allows for reading StdIn concurrently, in a way that it can be interrupted. It was introduced in #2168 to fix input conflicts when watch and interactive modes are used together.

Two scenarios are possible when a new process uses waitforLine to read StdIn:

  • if there is no ongoing reads taking place a future reading StdIn is started and the process waits until there's a new input line or until it is interrupted
  • if there is an ongoing read, the process waits for the result of the ongoing future or until it is interrupted.

Effectively, if used in parallel, the potential input is copied and distributed among the callers of waitForLine

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def waitForLine(atMost: Duration): Option[String]

Wait for a line to be read from StdIn

Wait for a line to be read from StdIn

Value parameters

atMost

duration to wait before timeout

Attributes

Returns

a line from StdIn wrapped in Some or None if end of stream was reached