Guppy.Native behaviour (guppy v0.2.0)

Copy Markdown View Source

Behaviour for the native GPUI bridge.

The default production direction is an in-VM NIF, following wx's overall integration model while keeping Guppy's own API and render architecture.

Summary

Callbacks

Performs a native request.

Types

command()

@type command() :: term()

response()

@type response() :: {:ok, term()} | {:error, term()}

Callbacks

request(server, command, timeout)

@callback request(GenServer.server(), command(), timeout()) :: response()

Performs a native request.

Implementations own timeout enforcement: request/3 must return within the given timeout (returning {:error, :native_timeout} when the underlying work cannot complete in time) rather than blocking the caller indefinitely. The NIF implementation bounds every request with a deadline-aware wait.