JvmAsyncOperations

gears.async.JvmAsyncOperations

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

override def `yield`()(using Async): Unit

Yields the current Async context, possibly allowing other computations to run.

Yields the current Async context, possibly allowing other computations to run.

Attributes

Definition Classes
def jvmInterruptible[T](fn: => T)(using Async): T

Runs fn in a cancellationScope where it will be interrupted (as a Java thread) upon cancellation.

Runs fn in a cancellationScope where it will be interrupted (as a Java thread) upon cancellation.

Note that fn will need to handle both java.util.concurrent.CancellationException (when performing Gears operations such as .await) and java.lang.InterruptedException, so the intended use case is usually to wrap interruptible Java operations, containing fn to a narrow scope.

Attributes

override def sleep(millis: Long)(using Async): Unit

Suspends the current Async context for at least millis milliseconds.

Suspends the current Async context for at least millis milliseconds.

Attributes

Definition Classes