chore: move NSQ and simple package to appleboy/queue (#613)

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu
2021-07-24 22:33:44 +08:00
committed by GitHub
parent cd14311f70
commit 7b16a4db98
9 changed files with 33 additions and 514 deletions

View File

@@ -14,11 +14,11 @@ import (
"github.com/appleboy/gorush/config"
"github.com/appleboy/gorush/core"
"github.com/appleboy/gorush/notify"
"github.com/appleboy/gorush/queue/simple"
"github.com/appleboy/gorush/status"
"github.com/appleboy/gofight/v2"
"github.com/appleboy/queue"
"github.com/appleboy/queue/simple"
"github.com/buger/jsonparser"
"github.com/gin-gonic/gin"
"github.com/stretchr/testify/assert"
@@ -36,7 +36,12 @@ func TestMain(m *testing.M) {
log.Fatal(err)
}
w = simple.NewWorker()
w = simple.NewWorker(
simple.WithRunFunc(func(msg queue.QueuedMessage) error {
notify.SendNotification(msg)
return nil
}),
)
q, _ = queue.NewQueue(
queue.WithWorker(w),
queue.WithWorkerCount(4),