queue.go 351 B

123456789101112131415
  1. package worker
  2. //go:generate moq -pkg mock -out mock/queue.go . Queue
  3. type QorJobDefinition struct {
  4. Name string
  5. Handler JobHandler
  6. }
  7. type Queue interface {
  8. Add(QueJobInterface) error
  9. Kill(QueJobInterface) error
  10. Remove(QueJobInterface) error
  11. Listen(jobDefs []*QorJobDefinition, getJob func(qorJobID uint) (QueJobInterface, error)) error
  12. }