mirror of
https://github.com/oarkflow/mq.git
synced 2025-10-05 07:57:00 +08:00
init: publisher
This commit is contained in:
@@ -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")
|
||||
|
Reference in New Issue
Block a user