TaskRunner
TaskRunner
evo.compute.tasks.common.runner.TaskRunner
Base class for compute task runners.
Subclass with concrete TParams and TResult type arguments and provide topic and task as class keyword arguments. The subclass is automatically registered with the :class:TaskRegistry.
Instances are awaitable: await runner submits the job, waits for completion, and returns the typed result with the execution context attached.
Example — defining a runner::
Example — advanced direct usage::
topic
The compute topic (e.g. "geostatistics").
task
The task name within the topic (e.g. "kriging").
params_type
The Pydantic parameters model, extracted automatically from the generic args.
result_model_type
The Pydantic result model, extracted automatically from the generic args.
result_type
The result type returned by the runner, typically a wrapper around the result model with convenience methods.
__call__
Submit the task, wait for completion, and return the typed result.
__await__
Make the runner directly awaitable: result = await Runner(ctx, params).