ReqManagedAgents.Provisioner (ReqManagedAgents v0.1.0)

Copy Markdown View Source

Hash-keyed provision cache. ensure/3 returns a cached provider handle for a given {provider, spec}, calling provider.provision/2 only on a miss. ETS-backed (process-independent); the handle is the durable artifact (persistable + reusable across processes), so the cache is an in-process optimization, not the source of truth.

Summary

Functions

Drop any cache entry whose value is handle (called after teardown).

Functions

ensure(provider, spec, opts \\ [])

@spec ensure(module(), ReqManagedAgents.Provider.spec(), keyword()) ::
  {:ok, ReqManagedAgents.Provider.handle()} | {:error, term()}

evict(handle)

@spec evict(ReqManagedAgents.Provider.handle()) :: :ok

Drop any cache entry whose value is handle (called after teardown).