chore(queue): support NSQ as backend. (#600)

This commit is contained in:
Bo-Yi Wu
2021-07-17 20:14:19 +08:00
committed by GitHub
parent c7112a6eb3
commit 2e2dd9b8d6
18 changed files with 272 additions and 12 deletions

View File

@@ -20,6 +20,16 @@ type Worker struct {
queueNotification chan gorush.PushNotification
}
// BeforeRun run script before start worker
func (s *Worker) BeforeRun() error {
return nil
}
// AfterRun run script after start worker
func (s *Worker) AfterRun() error {
return nil
}
// Run start the worker
func (s *Worker) Run(_ chan struct{}) error {
for notification := range s.queueNotification {

View File

@@ -5,6 +5,7 @@ import (
"testing"
"github.com/appleboy/gorush/gorush"
"github.com/stretchr/testify/assert"
)