ASM.ProviderBackend behaviour (ASM v0.9.2)

Copy Markdown View Source

Runtime contract for provider backends.

Both landed backend lanes satisfy this behaviour:

Lane selection is owned by ASM.ProviderRegistry and remains orthogonal to execution_mode.

Summary

Callbacks

close(pid)

@callback close(pid()) :: :ok

end_input(pid)

@callback end_input(pid()) :: :ok | {:error, term()}

info(pid)

@callback info(pid()) :: ASM.ProviderBackend.Info.t()

interrupt(pid)

@callback interrupt(pid()) :: :ok | {:error, term()}

send_input(pid, iodata, keyword)

@callback send_input(pid(), iodata(), keyword()) :: :ok | {:error, term()}

start_run(map)

@callback start_run(map()) ::
  {:ok, pid(), ASM.ProviderBackend.Info.t()} | {:error, term()}

subscribe(pid, pid, reference)

@callback subscribe(pid(), pid(), reference()) :: :ok | {:error, term()}