Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PushResult ¶
PushResult is information of pushed job except those in jobqueue.IncomingJob itself.
type RunningQueue ¶
type RunningQueue interface { jobqueue.JobQueue PollingInterval() uint MaxWorkers() uint WorkerStats() *dispatcher.Stats }
RunningQueue is an interface of a running queue, which is a job queue and its dispatcher combined.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is an application use case service that manages running queues.
func NewService ¶
func NewService(repos *repository.Repositories) *Service
NewService creates a new Service instance.
func (*Service) AddJobQueue ¶
AddJobQueue defines a new queue and starts it.
This method is goroutine safe.
func (*Service) DeleteJobQueue ¶
DeleteJobQueue stops a running queue of name qn and removes it from the queue definition list.
This method is goroutine safe.
func (*Service) GetJobQueue ¶
func (s *Service) GetJobQueue(qn string) (RunningQueue, bool)
GetJobQueue returns a RunningQueue of name qn. The second return value is false ff no queue is found.
This method is goroutine safe.
func (*Service) Push ¶
func (s *Service) Push(job jobqueue.IncomingJob) (*PushResult, error)
Push pushes a job to a queue. The target queue is determined by the category of the job and defined routings.