Skip to main content

ClikaRT::runtime::Executor

class

Header: ClikaRT/runtime/executor.h

ClikaRT::runtime::Executor: drives ONE Model node; admits requests, runs its phases (continuous-batched across sessions), and delivers results. This is the single-node engine; a multi-node ensemble is a Pipeline. The executor does NOT own the model; keep the Model alive for the executor's lifetime. Opaque handle (move-only).

Drives ONE Model: admits requests, runs its phases (continuous-batched across sessions), and delivers results.

The single-node engine (Pipeline is the multi-node ensemble). Does NOT own the model; keep the Model alive for the executor's lifetime. Move-only handle; shutdown() drains in-flight work.

auto ex = ClikaRT::runtime::Executor::create(model);
auto sid = ex.enqueue(std::move(request));
auto out = ex.await(sid);

Static member functions​

create()​

static Executor create(Model& model, ExecConfig config = {})

Build an executor bound to model (borrowed; must outlive the executor). Uses the built-in continuous batcher + FIFO scheduler, tuned by config. detail::contain wraps the model's overrides here, in your translation unit, so a throw from one is caught caller-side and fails the session; it never unwinds into the engine.

Declared in ClikaRT/runtime/executor.h, line 42

Member functions​

Executor()​

Executor(Executor&& other) noexcept

Declared in ClikaRT/runtime/executor.h, line 44

operator=()​

Executor& operator=(Executor&& other) noexcept

Move-only handle; the moved-from object is empty.

Declared in ClikaRT/runtime/executor.h, line 46

~Executor()​

~Executor()

Implicitly shuts down and releases the engine.

Declared in ClikaRT/runtime/executor.h, line 48

enqueue()​

SessionId enqueue(Request request)

Submit a request; returns its session handle. Non-blocking. The request is validated against the model's ModelSchema before anything runs: every non-optional input present, each supplied input's dtype, rank and every concrete dim as declared (a spec that declares no dims constrains the dtype alone), and inputs sharing a dim_names entry agreeing on that extent; a violation is refused here with Status::InvalidArgument naming the input. An input the schema does not declare is carried through untouched (the phase body may read it).

Declared in ClikaRT/runtime/executor.h, line 59

await()​

Response await(SessionId session)

Block until session completes; return its final response.

Declared in ClikaRT/runtime/executor.h, line 64

cancel()​

void cancel(SessionId session)

Cooperatively cancel an in-flight session.

Declared in ClikaRT/runtime/executor.h, line 68

shutdown()​

void shutdown()

Drain in-flight work and stop. When shutdown() returns, every accepted session has completed and await() still returns its result. A later enqueue() is refused with an InvalidArgument-status error whose code_name() is "FAILED_PRECONDITION".

Declared in ClikaRT/runtime/executor.h, line 75