Documentation
¶
Overview ¶
Package executionruntime fences actual executor compatibility at lease entry and carries resolved demand through ordinary workflow reschedules. It does not change JobDB's lease selection or add a separate persistence store.
Index ¶
- type Runtime
- func (r *Runtime) GetJobLease(ctx context.Context, req jobdb.GetJobLeaseRequest) (jobdb.ExecutionLease, error)
- func (r *Runtime) PollWork(ctx context.Context, req jobdb.PollWorkRequest) ([]jobdb.ExecutionLease, error)
- func (r *Runtime) RunWithLease(ctx context.Context, supplied jobdb.ExecutionLease, ...) (jobworkflow.JobRunOutcome, error)
- func (r *Runtime) Stage(key jobdb.JobKey, demand execution.Demand)
- func (r *Runtime) WrapTaskWorker(worker jobworkflow.TaskWorker) jobworkflow.TaskWorker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Runtime ¶
type Runtime struct {
jobdb.WorkflowRuntime
Allocation execution.Allocation
OnHandoff func(compiler.ExecutionHandoff)
// contains filtered or unexported fields
}
func New ¶
func New(runtime jobdb.WorkflowRuntime, allocation execution.Allocation, handoff func(compiler.ExecutionHandoff)) *Runtime
func (*Runtime) GetJobLease ¶
func (r *Runtime) GetJobLease(ctx context.Context, req jobdb.GetJobLeaseRequest) (jobdb.ExecutionLease, error)
func (*Runtime) PollWork ¶
func (r *Runtime) PollWork(ctx context.Context, req jobdb.PollWorkRequest) ([]jobdb.ExecutionLease, error)
func (*Runtime) RunWithLease ¶ added in v0.0.56
func (r *Runtime) RunWithLease(ctx context.Context, supplied jobdb.ExecutionLease, req jobworkflow.GetJobForRunRequest, listener jobworkflow.JobRunListener) (jobworkflow.JobRunOutcome, error)
RunWithLease executes exactly one supplied lease using JobDB's shared runner. It validates and renews before allocation admission or application work, and never acquires replacement work. Configure the recipe worker with this runtime's Stage and WrapTaskWorker, as for ordinary claim-and-run execution. BeforeRun, when provided, runs after successful allocation admission under the same renewing lease. WorkerID should normally be left empty to retain the supplied lease's owner.
func (*Runtime) WrapTaskWorker ¶
func (r *Runtime) WrapTaskWorker(worker jobworkflow.TaskWorker) jobworkflow.TaskWorker
WrapTaskWorker checks needs only when JobDB actually invokes a task worker, after looking up completed results. Use it for every worker in the workset.