SnakeBridge.RuntimeClient behaviour (SnakeBridge v0.9.0)

View Source

Behaviour for runtime clients that execute SnakeBridge payloads.

The default runtime client is Snakepit, but tests can override this via the :runtime_client config or a per-process override.

Summary

Types

callback()

@type callback() :: (term() -> any())

opts()

@type opts() :: keyword()

payload()

@type payload() :: map()

tool()

@type tool() :: String.t()

Callbacks

execute(tool, payload, opts)

@callback execute(tool(), payload(), opts()) ::
  {:ok, term()} | {:error, Snakepit.Error.t()}

execute_stream(tool, payload, callback, opts)

@callback execute_stream(tool(), payload(), callback(), opts()) ::
  :ok | {:error, Snakepit.Error.t()}