Documentation
¶
Overview ¶
Package instance manages configured resources independently of processes and connections. Consumers supply a key including tenant/subject scope as needed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrCapacity = errors.New("plugin instance capacity reached")
var ErrUpdating = errors.New("plugin instance update in progress")
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager[T any] struct { // contains filtered or unexported fields }
func (*Manager[T]) Close ¶
Close stops admission and waits for leases/factories/disposals. A deadline leaves the manager closed; callers can wait again. Resources are never destroyed while leased. Cleanup callbacks must be bounded by their owner.
func (*Manager[T]) Configure ¶
func (m *Manager[T]) Configure(ctx context.Context, key, revision string, config json.RawMessage) error
Configure atomically replaces an instance only after successful validation and creation. Revision must change with configuration. Existing leases keep the old instance alive until released. Factories must honor ctx; callbacks are called outside the manager lock. Capacity includes retiring instances.