Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DeDuplicator ¶
type DeDuplicator interface { // Check the uniqueness of the unique job and set the unique flag if it is not set yet. // // Parameters: // jobName string : name of the job // params models.Parameters : parameters of the job // // Returns: // If no unique flag and successfully set it, a nil error is returned; // otherwise, a non nil error is returned. MustUnique(jobName string, params job.Parameters) error // Remove the unique flag after job exiting // Parameters: // jobName string : name of the job // params models.Parameters : parameters of the job // // Returns: // If unique flag is successfully removed, a nil error is returned; // otherwise, a non nil error is returned. DelUniqueSign(jobName string, params job.Parameters) error }
DeDuplicator is designed to handle the uniqueness of the job. Once a job is declared to be unique, the job can be enqueued only if no same job (same job name and parameters) in the queue or running in progress. Adopt the same unique mechanism with the upstream framework.
func NewDeDuplicator ¶
func NewDeDuplicator(ns string, pool *redis.Pool) DeDuplicator
NewDeDuplicator is constructor of redisDeDuplicator
Click to show internal directories.
Click to hide internal directories.