AbstractExprEvaluatorPool

Abstract base class for a pool of AbstractExprEvaluator instances.

Uses a coroutine Channel as a bounded buffer to manage evaluator instances. Subclasses are responsible for populating the pool in their init block.

Parameters

size

the number of evaluator instances in the pool

Type Parameters

T

the concrete type of AbstractExprEvaluator managed by this pool

Constructors

Link copied to clipboard
constructor(size: Int)

Properties

Link copied to clipboard

Returns true if there are no evaluator instances currently available in the pool.

Link copied to clipboard
val size: Int

Functions

Link copied to clipboard
fun <R> blockingEval(expr: String): R

Evaluates the given expression by borrowing an evaluator from the pool, blocking the current thread.

Link copied to clipboard
suspend fun <R> eval(expr: String): R