mixin

Funcs

Funcs : Funcs

meta mixin slots py

Create a new PySession instance

pyTimeout

Set the timeout for pyEval()

pyInit

Initialize the python session by calling the given func to do any one-time setup of the python session

pyDefine

Define a variable to be available to python code running in the session

pyExec

Execute the given python code in the session and return the python session

pyEval

Evalue the given python statement in the session, and return the result

py (opts: Dict?) => PySession <admin>

Create a new PySession instance. Options:

  • image: name of the Docker image to run. By default, the lib will try to run the following images in this order:
    1. ghcr.io/haxall/hxpy:<ver> (where ver = current library Haxall version)
    2. ghcr.io/haxall/hxpy:latest
    3. ghcr.io/haxall/hxpy:main
  • network: the name of the Docker network you want the container to join.
  • logLevel: log level of the hxpy python process in Docker. Valid values are 'WARN', 'INFO', 'DEBUG', (default='WARN')

The default timeout for pyEval() is 5min. Use pyTimeout() to change this timeout.

Sessions created in the context of a task are persistent, meaning they will not be closed until the task is killed.

pyTimeout (py: PySession, val: Number?) => PySession <admin>

Set the timeout for pyEval().

pyInit (py: PySession, fn: Func) => PySession <admin>

Initialize the python session by calling the given func to do any one-time setup of the python session. If pyInit() has already been called on this session, then the callback is not invoked.

Typically, this func is used in the context of a task since the python session in a task is persistent. This allows to do any one-time pyExec() or pyDefine() when the task is first creatd.

pyDefine (py: PySession, name: Str, val: Obj?) => PySession <admin>

Define a variable to be available to python code running in the session.

pyExec (py: PySession, code: Str) => PySession <admin>

Execute the given python code in the session and return the python session. Note: python exec() does not return a value, so use pyEval() if you need the result of running a python statement. This method is primarily useful for declaring functions that you want available when using pyEval().

pyEval (py: PySession, stmt: Str) => Obj? <admin>

Evalue the given python statement in the session, and return the result. The session will be closed unless it is running in a task.

Haxall 4.0.5 ∙ 24-Feb-2026 14:33 EST