Source File
context.go
Belonging Package
github.com/hibiken/asynq
// Copyright 2020 Kentaro Hibino. All rights reserved.// Use of this source code is governed by a MIT license// that can be found in the LICENSE file.package asynqimport (asynqcontext)// GetTaskID extracts a task ID from a context, if any.//// ID of a task is guaranteed to be unique.// ID of a task doesn't change if the task is being retried.func ( context.Context) ( string, bool) {return asynqcontext.GetTaskID()}// GetRetryCount extracts retry count from a context, if any.//// Return value n indicates the number of times associated task has been// retried so far.func ( context.Context) ( int, bool) {return asynqcontext.GetRetryCount()}// GetMaxRetry extracts maximum retry from a context, if any.//// Return value n indicates the maximum number of times the associated task// can be retried if ProcessTask returns a non-nil error.func ( context.Context) ( int, bool) {return asynqcontext.GetMaxRetry()}// GetQueueName extracts queue name from a context, if any.//// Return value queue indicates which queue the task was pulled from.func ( context.Context) ( string, bool) {return asynqcontext.GetQueueName()}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |