Insider.Sentinel.Sandbox.Body behaviour (Insider Lab v0.1.0)

Copy Markdown View Source

Behaviour for trusted work that runs while a disposable target lease is live.

Body modules are host-configured and selected by module reference through the direct API. Portable target and request data never select a module. A body must not return until all work it owns has stopped; it should handle the {:cancel_sandbox_body, cancellation_reference} message and return promptly.

Summary

Types

arguments()

@type arguments() :: %{
  owner_id: binary(),
  target: Insider.Sentinel.Sandbox.Target.t(),
  observed_provenance: map(),
  input: map(),
  deadline: integer(),
  stop_deadline: integer(),
  cancellation_reference: reference()
}

Callbacks

identity()

@callback identity() :: map()

run(arguments)

@callback run(arguments()) :: {:ok, map()} | {:error, atom(), map()} | {:cancelled, map()}