mirror of
https://github.com/hibiken/asynq.git
synced 2025-08-19 15:08:55 +08:00
first cut
This commit is contained in:
committed by
Ken Hibino
parent
8bd70c6f84
commit
d7ceb0c090
@@ -11,6 +11,8 @@ import (
|
||||
"github.com/hibiken/asynq/internal/base"
|
||||
)
|
||||
|
||||
type BaseContext func() context.Context
|
||||
|
||||
// A taskMetadata holds task scoped data to put in context.
|
||||
type taskMetadata struct {
|
||||
id string
|
||||
@@ -28,7 +30,7 @@ type ctxKey int
|
||||
const metadataCtxKey ctxKey = 0
|
||||
|
||||
// New returns a context and cancel function for a given task message.
|
||||
func New(msg *base.TaskMessage, deadline time.Time) (context.Context, context.CancelFunc) {
|
||||
func New(base context.Context, msg *base.TaskMessage, deadline time.Time) (context.Context, context.CancelFunc) {
|
||||
metadata := taskMetadata{
|
||||
id: msg.ID,
|
||||
maxRetry: msg.Retry,
|
||||
|
Reference in New Issue
Block a user