adk_eval_worker behaviour (erlang_adk v0.10.0)

View Source

Optional evaluation worker transport behaviour.

Worker transports are configured by trusted runtime options. A transport owns cancellation and must send exactly one terminal message to Owner: {adk_eval_worker_terminal, Module, Ref, Outcome} where Outcome follows the adk_task terminal outcome contract.

Summary

Types

outcome/0

-type outcome() ::
          {completed, {ok, map()} | {error, term()}} |
          {failed, term()} |
          {timed_out, term()} |
          {cancelled, term()}.

Callbacks

cancel/2

-callback cancel(Handle :: term(), Reason :: term()) -> ok | {error, already_terminal | not_found | term()}.

capabilities/1

(optional)
-callback capabilities(Config :: map()) -> map().

start/3

-callback start(Request :: map(), Owner :: pid(), Config :: map()) ->
                   {ok, Ref :: reference(), Handle :: term()} | {error, term()}.