Ox

ox.Ox$
See theOx companion class
object Ox

Attributes

Companion:
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Ox.type

Members list

Concise view

Type members

Classlikes

trait Fork[T]

A running fork, started using Ox.fork or Ox.forkHold, backend by a thread.

A running fork, started using Ox.fork or Ox.forkHold, backend by a thread.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
class ForkLocal[T](scopedValue: ScopedValue[T], default: T)

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
object ForkLocal

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
object syntax

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
syntax.type

Inherited types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def forever(f: => Unit): Nothing
def fork[T](f: => T)(using Ox): Fork[T]

Starts a thread, which is guaranteed to complete before the enclosing scoped block exits.

Starts a thread, which is guaranteed to complete before the enclosing scoped block exits.

Exceptions are propagated. In case an exception is thrown while evaluating t, the enclosing scope's main thread is interrupted and the exception is re-thrown there.

Attributes

def forkAllHold[T](fs: Seq[() => T])(using Ox): Fork[Seq[T]]
def forkHold[T](f: => T)(using Ox): Fork[T]

Starts a thread, which is guaranteed to complete before the enclosing scoped block exits.

Starts a thread, which is guaranteed to complete before the enclosing scoped block exits.

Exceptions are held. In case an exception is thrown while evaluating t, it will be thrown when calling the returned Fork's .join() method. The exception is not propagated to the enclosing scope's main thread, like in the case of fork.

Attributes

def raceResult[T](fs: Seq[() => T]): T
def raceResult[T](f1: => T)(f2: => T): T

Returns the result of the first computation to complete (either successfully or with an exception).

Returns the result of the first computation to complete (either successfully or with an exception).

Attributes

def raceSuccess[T](fs: Seq[() => T]): T
def raceSuccess[T](f1: => T)(f2: => T): T

Returns the result of the first computation to complete successfully, or if all fail - throws the first exception.

Returns the result of the first computation to complete successfully, or if all fail - throws the first exception.

Attributes

def retry[T](times: Int, sleep: FiniteDuration)(f: => T): T
def scoped[T](f: Ox ?=> T): T

Any child forks are interrupted after f completes.

Any child forks are interrupted after f completes.

Attributes

def timeout[T](duration: FiniteDuration)(t: => T): T
def uninterruptible[T](f: => T): T