mirror of
https://github.com/oarkflow/mq.git
synced 2025-10-26 00:10:20 +08:00
refactor: move examples
This commit is contained in:
@@ -1,20 +0,0 @@
|
||||
package tasks
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/oarkflow/mq"
|
||||
)
|
||||
|
||||
func SchedulerHandler(ctx context.Context, task *mq.Task) mq.Result {
|
||||
fmt.Printf("Processing task: %s\n", task.ID)
|
||||
return mq.Result{Error: nil}
|
||||
}
|
||||
|
||||
func SchedulerCallback(ctx context.Context, result mq.Result) error {
|
||||
if result.Error != nil {
|
||||
fmt.Println("Task failed!", result.Error.Error())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user