KotlinExprEvaluatorPool
class KotlinExprEvaluatorPool @JvmOverloads constructor(size: Int, resetEvery: Int = DEFAULT_RESET_EVERY) : AbstractExprEvaluatorPool<KotlinExprEvaluator>
A pre-populated pool of KotlinExprEvaluator instances backed by a coroutine Channel.
Instances are created eagerly during initialization.
A fresh Kotlin REPL costs several times an evaluation, and each evaluation adds to the REPL's history, so an evaluator's context is reset every resetEvery returns rather than every time: about 20 keeps the reset cost small per evaluation while holding each evaluator's history to some tens of megabytes. See AbstractExprEvaluatorPool.
Parameters
size
the number of KotlinExprEvaluator instances to create in the pool
resetEvery
how many times an evaluator is returned between resets of its context; defaults to DEFAULT_RESET_EVERY, and 1 resets on every return
Types
Link copied to clipboard
object Companion
Constants for KotlinExprEvaluatorPool.