mirror of
https://github.com/hibiken/asynq.git
synced 2025-09-19 05:17:30 +08:00
review corrections
This commit is contained in:
10
server.go
10
server.go
@@ -97,10 +97,11 @@ type Config struct {
|
||||
// to the number of CPUs usable by the current process.
|
||||
Concurrency int
|
||||
|
||||
// BaseContext optionally specifies a function that returns
|
||||
// the base context for invocations on this server.
|
||||
// BaseContext optionally specifies a function that returns the base context for Handler invocations on this server.
|
||||
//
|
||||
// If BaseContext is nil, the default is context.Background().
|
||||
BaseContext func() context.Context
|
||||
// If this is defined, then it MUST return a non-nil context
|
||||
BaseContext BaseCtxFn
|
||||
|
||||
// SleepOnEmptyQueue optionally specifies the amount of time to wait before polling again when there are no messages in the queue
|
||||
SleepOnEmptyQueue time.Duration
|
||||
@@ -211,6 +212,9 @@ func (fn ErrorHandlerFunc) HandleError(ctx context.Context, task *Task, err erro
|
||||
fn(ctx, task, err)
|
||||
}
|
||||
|
||||
// BaseCtxFn provides the root context from where the execution contexts of tasks are derived
|
||||
type BaseCtxFn func() context.Context
|
||||
|
||||
// RetryDelayFunc calculates the retry delay duration for a failed task given
|
||||
// the retry count, error, and the task.
|
||||
//
|
||||
|
Reference in New Issue
Block a user