Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ScanDataExport ¶
type ScanDataExport struct {
// contains filtered or unexported fields
}
ScanDataExport is the struct to implement the scan data export. implements the Job interface
func (*ScanDataExport) MaxCurrency ¶
func (sde *ScanDataExport) MaxCurrency() uint
MaxCurrency of the job. Unlike the WorkerPool concurrency, it controls the limit on the number jobs of that type that can be active at one time by within a single redis instance. The default value is 0, which means "no limit on job concurrency".
func (*ScanDataExport) MaxFails ¶
func (sde *ScanDataExport) MaxFails() uint
func (*ScanDataExport) Run ¶
func (sde *ScanDataExport) Run(ctx job.Context, params job.Parameters) error
Run the business logic here. The related arguments will be injected by the workerpool.
ctx Context : Job execution context. params map[string]interface{} : parameters with key-pair style for the job execution.
Returns:
error if failed to run. NOTES: If job is stopped or cancelled, a specified error should be returned
func (*ScanDataExport) ShouldRetry ¶
func (sde *ScanDataExport) ShouldRetry() bool
ShouldRetry tells worker if retry the failed job when the fails is still less that the number declared by the method 'MaxFails'.
Returns:
true for retry and false for none-retry
func (*ScanDataExport) Validate ¶
func (sde *ScanDataExport) Validate(_ job.Parameters) error
Validate Indicate whether the parameters of job are valid. Return: error if parameters are not valid. NOTES: If no parameters needed, directly return nil.