diff options
-rw-r--r-- | pkg/priority_queue/interface.go | 2 | ||||
-rw-r--r-- | pkg/priority_queue/queue.go | 4 | ||||
-rw-r--r-- | plugins/jobs/plugin.go | 13 |
3 files changed, 16 insertions, 3 deletions
diff --git a/pkg/priority_queue/interface.go b/pkg/priority_queue/interface.go index d1c3229f..5945a013 100644 --- a/pkg/priority_queue/interface.go +++ b/pkg/priority_queue/interface.go @@ -2,6 +2,6 @@ package priorityqueue type Queue interface { Push() - Pop() + Pop() interface{} BLPop() } diff --git a/pkg/priority_queue/queue.go b/pkg/priority_queue/queue.go index 88d18acb..79afab18 100644 --- a/pkg/priority_queue/queue.go +++ b/pkg/priority_queue/queue.go @@ -12,8 +12,8 @@ func (q *QueueImpl) Push() { } -func (q *QueueImpl) Pop() { - +func (q *QueueImpl) Pop() interface{} { + return nil } func (q *QueueImpl) BLPop() { diff --git a/plugins/jobs/plugin.go b/plugins/jobs/plugin.go index 90932edd..8c5a665e 100644 --- a/plugins/jobs/plugin.go +++ b/plugins/jobs/plugin.go @@ -95,6 +95,19 @@ func (p *Plugin) Serve() chan error { // start consume loop // start resp loop + /* + go func() { + for { + // get data JOB from the queue + job := p.queue.Pop() + + // request + _ = job + p.workersPool.Exec(nil) + } + }() + + */ return errCh } |