Reorganized directories and packages.
This commit is contained in:
parent
1018d82d13
commit
72ce41c828
61 changed files with 83 additions and 83 deletions
22
pkg/tasks/example.go
Normal file
22
pkg/tasks/example.go
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
package tasks
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log"
|
||||
|
||||
"github.com/hibiken/asynq"
|
||||
)
|
||||
|
||||
// TypeExample is the type for the example task.
|
||||
// This is what is passed in to TaskClient.New() when creating a new task
|
||||
const TypeExample = "example_task"
|
||||
|
||||
// ExampleProcessor processes example tasks
|
||||
type ExampleProcessor struct {
|
||||
}
|
||||
|
||||
// ProcessTask handles the processing of the task
|
||||
func (p *ExampleProcessor) ProcessTask(ctx context.Context, t *asynq.Task) error {
|
||||
log.Printf("executing task: %s", t.Type())
|
||||
return nil
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue