KotlinScriptPool

class KotlinScriptPool(size: Int, nullGlobalContext: Boolean) : AbstractScriptPool<KotlinScript>

A pre-populated pool of KotlinScript instances backed by a coroutine Channel.

Instances are created eagerly during initialization and recycled with context resets after each use.

Parameters

size

the number of KotlinScript instances to create in the pool

nullGlobalContext

if true, resets the global scope bindings to null when recycling

Constructors

Link copied to clipboard
constructor(size: Int, nullGlobalContext: Boolean)

Properties

Link copied to clipboard
Link copied to clipboard
val size: Int

Functions

Link copied to clipboard
suspend fun <R> eval(block: KotlinScript.() -> R): R