MCScope

class MCScope(val coroutineContext: CoroutineContext, val random: RandomGenerator)(source)

A scope for a Monte-Carlo computations or multi-coroutine random number generation. The scope preserves the order of random generator calls as long as all concurrency calls is done via launch and async functions.

Constructors

Link copied to clipboard
constructor(coroutineContext: CoroutineContext, random: RandomGenerator)

Functions

Link copied to clipboard
Link copied to clipboard
inline fun <T> MCScope.async(context: CoroutineContext = EmptyCoroutineContext, start: CoroutineStart = CoroutineStart.DEFAULT, crossinline block: suspend MCScope.() -> T): Deferred<T>

Specialized async for MCScope. Behaves the same way as regular CoroutineScope.async, but also stores the generator fork. The method itself is not thread safe.

Link copied to clipboard
inline fun MCScope.launch(context: CoroutineContext = EmptyCoroutineContext, start: CoroutineStart = CoroutineStart.DEFAULT, crossinline block: suspend MCScope.() -> Unit): Job

Specialized launch for MCScope. Behaves the same way as regular CoroutineScope.launch, but also stores the generator fork. The method itself is not thread safe.

Properties

Link copied to clipboard
Link copied to clipboard