Services.TempFile (fnord v0.8.88)

View Source

Singleton service for creating temporary files via Briefly.

This centralizes ownership of Briefly-created temp files to a single long-lived process, so that files can survive across multiple tool calls within the same BEAM node. All options are passed through to Briefly.create/1 unchanged, allowing future callers to migrate without changing their option shapes.

Summary

Functions

Returns a specification to start this module under a supervisor.

Create a new temporary file via Briefly.

Like mktemp/1, but raises on error.

Types

opts()

@type opts() :: Keyword.t()

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

mktemp(opts \\ [])

@spec mktemp(opts()) :: {:ok, Path.t()} | {:error, term()}

Create a new temporary file via Briefly.

Accepts an optional keyword list of options and forwards them unchanged to Briefly.create/1.

mktemp!(opts \\ [])

@spec mktemp!(opts()) :: Path.t()

Like mktemp/1, but raises on error.

start_link(opts)

@spec start_link(any()) :: GenServer.on_start()