Move Broker interface to base package

This commit is contained in:
Ken Hibino
2020-04-18 07:55:10 -07:00
parent 46ab4417dd
commit 7c7f8e5f30
8 changed files with 176 additions and 38 deletions

View File

@@ -7,11 +7,13 @@ package asynq
import (
"sync"
"time"
"github.com/hibiken/asynq/internal/base"
)
type scheduler struct {
logger Logger
broker broker
broker base.Broker
// channel to communicate back to the long running "scheduler" goroutine.
done chan struct{}
@@ -23,7 +25,7 @@ type scheduler struct {
qnames []string
}
func newScheduler(l Logger, b broker, avgInterval time.Duration, qcfg map[string]int) *scheduler {
func newScheduler(l Logger, b base.Broker, avgInterval time.Duration, qcfg map[string]int) *scheduler {
var qnames []string
for q := range qcfg {
qnames = append(qnames, q)