Skip to main content

Executor

Drives ONE node: admits requests, runs its phases (continuous-batched across sessions), and delivers results. Keeps the node alive. Usable as a context manager (shutdown on exit).

node (property)​

The node this executor drives.

__init__​

__init____init__(self, node: clika_runtime._core.runtime.Node, config: clika_runtime._core.runtime.ExecConfig = ExecConfig(max_batch=0, work_budget=0, step_token_budget=0, max_active_sessions=1, max_queued=0, stream=None)) -> None

init(self, node: clika_runtime._core.runtime.Node, config: clika_runtime._core.runtime.ExecConfig = ExecConfig(max_batch=0, work_budget=0, step_token_budget=0, max_active_sessions=1, max_queued=0, stream=None)) -> None

An executor over node, tuned by config.

cancel​

cancelcancel(self, session: int) -> None

cancel(self, session: int) -> None

Cooperatively cancel an in-flight session; wait() on it then reports the cancellation.

create​

create(*args, **kwargs)

create(node: clika_runtime._core.runtime.Node, config: clika_runtime._core.runtime.ExecConfig = ExecConfig(max_batch=0, work_budget=0, step_token_budget=0, max_active_sessions=1, max_queued=0, stream=None)) -> clika_runtime._core.runtime.Executor

An executor over node, tuned by config (the same as Executor(node, config)).

enqueue​

enqueueenqueue(self, request: clika_runtime._core.runtime.Request) -> int

enqueue(self, request: clika_runtime._core.runtime.Request) -> int

Submit a request; returns the session id. Non-blocking.

run​

runrun(self, request: clika_runtime._core.runtime.Request) -> clika_runtime._core.runtime.Response

run(self, request: clika_runtime._core.runtime.Request) -> clika_runtime._core.runtime.Response

enqueue() then wait() in one call.

shutdown​

shutdownshutdown(self) -> None

shutdown(self) -> None

Drain in-flight work and stop; every accepted session completes and wait() still returns its result. A later enqueue() raises.

wait​

waitwait(self, session: int) -> clika_runtime._core.runtime.Response

wait(self, session: int) -> clika_runtime._core.runtime.Response

Block until the session completes; returns its Response (a failed session raises RuntimeError).