Detach prepared execution ownership from runners
This commit is contained in:
@@ -43,6 +43,7 @@ var (
|
||||
|
||||
// Runner executes the Promptkit core use case.
|
||||
type Runner struct {
|
||||
identity *runnerIdentity
|
||||
promptDefs promptdef.Repository
|
||||
profiles profile.Repository
|
||||
artifacts artifact.Reader
|
||||
@@ -54,6 +55,10 @@ type Runner struct {
|
||||
defaultTransientRetries uint64
|
||||
}
|
||||
|
||||
// A non-zero-sized token gives each constructed runner a distinct identity
|
||||
// without retaining its collaborators in prepared handles.
|
||||
type runnerIdentity struct{ marker byte }
|
||||
|
||||
// RunAdmitter reserves capacity for one resolved backend run.
|
||||
type RunAdmitter interface {
|
||||
Admit(context.Context, string) (func(), error)
|
||||
@@ -113,6 +118,7 @@ func NewRunnerWithRepairer(
|
||||
retries = defaultTransientRetries[0]
|
||||
}
|
||||
return &Runner{
|
||||
identity: &runnerIdentity{},
|
||||
promptDefs: promptDefs,
|
||||
profiles: profiles,
|
||||
artifacts: artifacts,
|
||||
|
||||
Reference in New Issue
Block a user