init: publisher

This commit is contained in:
sujit
2024-09-30 21:09:48 +05:45
parent 93190ffc74
commit afd43302ef
6 changed files with 71 additions and 88 deletions

View File

@@ -8,9 +8,9 @@ import (
)
func main() {
b := mq.NewBroker(mq.WithCallback(func(ctx context.Context, task *mq.Task) error {
b := mq.NewBroker(mq.WithCallback(func(ctx context.Context, task *mq.Task) mq.Result {
fmt.Println("Received task", task.ID, "Payload", string(task.Payload), "Result", string(task.Result), task.Error, task.CurrentQueue)
return nil
return mq.Result{}
}))
b.NewQueue("queue1")
b.NewQueue("queue2")