ACP.MessageHandler behaviour (agent_client_protocol v0.1.0)

Copy Markdown View Source

Behaviour for handling incoming JSON-RPC requests and notifications.

Implementations route decoded requests to the appropriate Agent or Client callbacks.

Summary

Callbacks

Handle an incoming notification.

Handle an incoming request and return a response.

Callbacks

handle_notification(notification)

@callback handle_notification(notification :: any()) :: :ok | {:error, ACP.Error.t()}

Handle an incoming notification.

handle_request(request)

@callback handle_request(request :: any()) :: {:ok, any()} | {:error, ACP.Error.t()}

Handle an incoming request and return a response.