mirror of
https://github.com/oarkflow/mq.git
synced 2025-10-05 16:06:55 +08:00
init: publisher
This commit is contained in:
@@ -8,10 +8,10 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
b := mq.NewBroker(func(ctx context.Context, task *mq.Task) error {
|
||||
b := mq.NewBroker(mq.WithCallback(func(ctx context.Context, task *mq.Task) error {
|
||||
fmt.Println("Received task", task.ID, "Payload", string(task.Payload), "Result", string(task.Result), task.Error, task.CurrentQueue)
|
||||
return nil
|
||||
})
|
||||
}))
|
||||
b.NewQueue("queue1")
|
||||
b.NewQueue("queue2")
|
||||
b.Start(context.Background(), ":8080")
|
||||
|
Reference in New Issue
Block a user