types

package
v0.0.0-...-a53f408 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchProcessor

type BatchProcessor interface {
	Process(Job) JobResult
}

BatchProcessor defines an interface for processing individual jobs. Implementers of this interface provide the logic for processing each job and returning the results.

type Job

type Job struct {
	Ctx     context.Context // Context associated with the job, allowing for cancellation, timeout, etc.
	ID      string          // Unique identifier for the job.
	Payload interface{}     // Content or data of the job for processing.
}

Job represents a unit of work to be processed

type JobResult

type JobResult struct {
	JobID       string      // Identifier for the processed job.
	BatchNumber int64       // Batch in which the job was processed.
	Output      interface{} // Result from processing the job.
	Err         error       // Any error encountered during processing.
}

JobResult captures the result of processing a Job

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL