PythonScriptPool

class PythonScriptPool(size: Int, nullGlobalContext: Boolean) : AbstractScriptPool<PythonScript>

A pre-populated pool of PythonScript 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 PythonScript 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: PythonScript.() -> R): R