Documentation ¶
Overview ¶
Package internal is none of your business
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FileLock ¶
type FileLock struct {
// contains filtered or unexported fields
}
FileLock provides a file lock mechanism based on flock.
func NewFileLock ¶
NewFileLock creates a new instance of FileLock.
type JobProcessor ¶
type JobProcessor struct {
// contains filtered or unexported fields
}
JobProcessor runs jobs with a set number of workers.
func NewJobProcessor ¶
func NewJobProcessor(ctx context.Context, workers int) *JobProcessor
NewJobProcessor inits a new JobProcessor struct.
func (*JobProcessor) Add ¶
func (j *JobProcessor) Add(job func(context.Context) error)
Add queues a job for processing.
func (*JobProcessor) Run ¶
func (j *JobProcessor) Run(ctx context.Context) error
Run processes the job queue and returns the first error encountered, if any.
func (*JobProcessor) Wait ¶
func (j *JobProcessor) Wait() error
Wait waits for all jobs to finish processing and returns the first error encountered, if any.
Click to show internal directories.
Click to hide internal directories.