job/queue.go
func AddWithDataAndDelay(q Queue, tx *reform.TX,
	jobType, relatedType, relatedID, creator string,
	jobData interface{}, delay time.Duration) error {
	data2, err := json.Marshal(jobData)
	if err != nil {
		return err
	}

	return q.Add(tx, &data.Job{
		Type:        jobType,
		RelatedType: relatedType,
		RelatedID:   relatedID,
		CreatedBy:   creator,
		Data:        data2,
		NotBefore:   time.Now().Add(delay),
	})
}
func AddWithDataAndDelay(q Queue, tx *reform.TX,
	jobType, relatedType, relatedID, creator string,
	jobData interface{}, delay time.Duration) error {
	data2, err := json.Marshal(jobData)
	if err != nil {
		return err
	}

	return q.Add(tx, &data.Job{
		Type:        jobType,
		RelatedType: relatedType,
		RelatedID:   relatedID,
		CreatedBy:   creator,
		Data:        data2,
		NotBefore:   time.Now().Add(delay),
	})
}
func AddWithDataAndDelay ( q Queue , tx * reform . TX , jobType , relatedType , relatedID , creator string , jobData interface { } , delay time . Duration ) error { data2 , err := json . Marshal ( jobData ) if err != nil { return err } return q . Add ( tx , & data . Job { Type : jobType , RelatedType : relatedType , RelatedID : relatedID , CreatedBy : creator , Data : data2 , NotBefore : time . Now ( ) . Add ( delay ) , } ) }
// AddWithDataAndDelay is convenience method to add a job with given data
// and delay.
AddWithDataAndDelay is convenience method to add a job with given data and delay .