Documentation ¶
Overview ¶
Package executor defines a "production-ready" executor for jobs.
For local/non-production use, consider looking at cmd/localjobs's executor
Index ¶
- func Create(ctx context.Context, pool *pgxpool.Pool, jobImpl interfaces.JobImpl) (*string, error)
- func Execute(ctx context.Context, ctxCancel context.CancelFunc, id string, ...)
- func GetPersistedState(tc *Progress) (*jobstate.Progress, error)
- func PersistState(tc *Progress, prog *jobstate.Progress) error
- type MutLogger
- type Progress
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Execute ¶
func Execute( ctx context.Context, ctxCancel context.CancelFunc, id string, jobImpl interfaces.JobImpl, prog *Progress, )
Creates a new job on server and executes it
If prog is set, it will be used to cache the progress, otherwise a blank one will be used
func GetPersistedState ¶
GetPersistedState gets persisted state from redis
Types ¶
type MutLogger ¶
func NewTaskLogger ¶
type Progress ¶
type Progress struct { ID string State State // Used to cache the current progress in resumes // // When resuming, set this to the current progress CurrentProgress *jobstate.Progress // OnSetProgress is a callback that is called when SetProgress is called // // If unset, calls PersistState OnSetProgress func(tc *Progress, prog *jobstate.Progress) error }
Click to show internal directories.
Click to hide internal directories.