SystemStreamsUtils

mill.api.SystemStreamsUtils

Utilities for managing and redirecting the SystemStreams modelling the stdin/stdout/stderr of the process

Attributes

Source
SystemStreamsUtils.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def withStreams[T](systemStreams: SystemStreams)(t: => T): T

Attributes

Source
SystemStreamsUtils.scala
def withTopLevelSystemStreamProxy[T](t: => T): T

Manages the global override of System.{in,out,err}. Overrides of those streams are global, so we cannot just override them per-use-site in a multithreaded environment because different threads may interleave and stomp over each other's over-writes.

Manages the global override of System.{in,out,err}. Overrides of those streams are global, so we cannot just override them per-use-site in a multithreaded environment because different threads may interleave and stomp over each other's over-writes.

Instead, we over-write them globally with a set of streams that does nothing but forward to the per-thread ThreadLocalStreams.current streams, allowing callers to each reach their own thread-local streams without clashing across multiple threads

Attributes

Source
SystemStreamsUtils.scala