Documentation
¶
Overview ¶
Package delay provides a task queue abstraction for background job execution. This is a standalone implementation that replaces the google.golang.org/appengine/delay package.
Index ¶
Constants ¶
const (
// Path is the HTTP path for invocations (maintained for compatibility)
Path = "/_/queue/delay"
)
Variables ¶
Functions ¶
Types ¶
type Function ¶
type Function struct {
// contains filtered or unexported fields
}
Function wraps a delayed function with queue configuration
func Func ¶
Func declares a new Function. The second argument must be a function with a first argument of type context.Context. This function must be called at program initialization time. That means it must be called in a global variable declaration or from an init function. This restriction is necessary because the instance that delays a function call may not be the one that executes it. Only the code executed at program initialization time is guaranteed to have been run by an instance before it receives a request.
func (*Function) Call ¶
Call invokes a delayed function asynchronously using goroutines. The function is executed in a background goroutine after any configured delay.
func (*Function) Once ¶
func (f *Function) Once(ctx context.Context, name string, delay time.Duration, args ...interface{}) error
Once adds a task only once by using a unique name. This prevents duplicate task execution.
type RequestHeaders ¶
RequestHeaders contains metadata from the task queue request. This replaces taskqueue.RequestHeaders from appengine.
func ParseRequestHeaders ¶
func ParseRequestHeaders(h http.Header) *RequestHeaders
ParseRequestHeaders extracts task queue headers from an HTTP request. This is a compatibility function for HTTP-based task invocation.