adk_service_ref (erlang_adk v0.7.0)

View Source

Validation and bounded invocation for optional ADK services.

Summary

Functions

Invoke a service callback in an isolated lightweight process. The service handle is prepended to Args. Exceptions, exits, and timeouts are converted to values so a third-party adapter cannot crash or indefinitely block an invocation process.

Types

kind/0

-type kind() :: memory | artifact.

service_ref/0

-type service_ref() :: {module(), term()}.

Functions

call(ServiceRef, Function, Args, Timeout)

-spec call(service_ref(), atom(), [term()], pos_integer()) -> term().

Invoke a service callback in an isolated lightweight process. The service handle is prepended to Args. Exceptions, exits, and timeouts are converted to values so a third-party adapter cannot crash or indefinitely block an invocation process.

validate(Kind, Other)

-spec validate(kind(), undefined | term()) -> {ok, undefined | service_ref()} | {error, term()}.