Continuations

continuations4s.Continuations
See theContinuations companion trait
object Continuations

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Inherited classlikes

trait SuspensionBase[-T, +R]

The delimited continuation suspension interface. Represents a suspended computation asking for a value of type T to continue (and eventually returning a value of type R, which is the result that the whole delimited continuation will eventually produce).

The delimited continuation suspension interface. Represents a suspended computation asking for a value of type T to continue (and eventually returning a value of type R, which is the result that the whole delimited continuation will eventually produce).

Attributes

Inherited from:
Continuations
Supertypes
class Object
trait Matchable
class Any

Inherited types

override type Boundary[+R] = R

Platform-specific result of boundary.

Platform-specific result of boundary.

Attributes

Inherited from:
VThreadSuspend (hidden)

Inherited and Abstract types

override opaque type Label[R]

A marker for the "limit" of "delimited continuation".

A marker for the "limit" of "delimited continuation".

Attributes

Inherited from:
VThreadSuspend (hidden)
override opaque type Suspension[-T, +R]

The provided suspension type.

The provided suspension type.

Attributes

Inherited from:
VThreadSuspend (hidden)

Value members

Inherited methods

override def boundary[R](body: Label[R] ?=> R): R

Set the suspension marker as the body's caller, and execute body.

Set the suspension marker as the body's caller, and execute body.

Attributes

Returns

the result of the boundary. Note that this is platform-specific. Ideally we could return just R, however, this either implies platform support for delimited continuations (Scala Native), or blocking threads (JVM). On top of JS/WASM engines, blocking can only happen in the context of a js.async scope, therefore, we have to work with js.Promise.

Definition Classes
VThreadSuspend -> Continuations
Inherited from:
VThreadSuspend (hidden)
override def boundaryAsFuture[R](body: Label[R] ?=> R)(using ExecutionContext): Future[R]

Variant of boundary that returns the result as a scala.concurrent.Future.

Variant of boundary that returns the result as a scala.concurrent.Future.

Common-denominator between platforms, useful for testing.

Attributes

Definition Classes
VThreadSuspend -> Continuations
Inherited from:
VThreadSuspend (hidden)
override def suspend[T, R](body: Suspension[T, R] => R)(using Label[R]): T

Should return immediately if resume is called from within body

Should return immediately if resume is called from within body

Attributes

Definition Classes
VThreadSuspend -> Continuations
Inherited from:
VThreadSuspend (hidden)