A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://cloud.google.com/appengine/docs/legacy/standard/go111/taskqueue/reference below:

Package google.golang.org/appengine/taskqueue (v1.6.8) | App Engine standard environment for Go 1.11 docs

Skip to main content Package google.golang.org/appengine/taskqueue (v1.6.8)

Stay organized with collections Save and categorize content based on your preferences.

Note: To get more information about this package, such as access to older versions, view this package on pkg.go.dev.

Package taskqueue provides a client for App Engine's taskqueue service. Using this service, applications may perform work outside a user's request.

A Task may be constructed manually; alternatively, since the most common taskqueue operation is to add a single POST task, NewPOSTTask makes it easy.

t := taskqueue.NewPOSTTask("/worker", url.Values{
    "key": {key},
})
taskqueue.Add(c, t, "") // add t to the default queue
Variables ErrTaskAlreadyAdded
var (
	// ErrTaskAlreadyAdded is the error returned by Add and AddMulti when a task has already been added with a particular name.
	ErrTaskAlreadyAdded = errors.New("taskqueue: task has already been added")
)
Functions func Delete

Delete deletes a task from a named queue.

func DeleteMulti

DeleteMulti deletes multiple tasks from a named queue. If a given task could not be deleted, an appengine.MultiError is returned. Each task is deleted independently; one may fail to delete while the others are successfully deleted.

func ModifyLease

ModifyLease modifies the lease of a task. Used to request more processing time, or to abandon processing. leaseTime is in seconds and must not be negative.

func Purge

Purge removes all tasks from a queue.

QueueStatistics
type QueueStatistics struct {
	Tasks     int       // may be an approximation
	OldestETA time.Time // zero if there are no pending tasks

	Executed1Minute int     // tasks executed in the last minute
	InFlight        int     // tasks executing now
	EnforcedRate    float64 // requests per second
}

QueueStatistics represents statistics about a single task queue.

func QueueStats

QueueStats retrieves statistics about queues.

RequestHeaders are the special HTTP request headers available to push task HTTP request handlers. These headers are set internally by App Engine. See https://cloud.google.com/appengine/docs/standard/go/taskqueue/push/creating-handlers#reading_request_headers for a description of the fields.

ParseRequestHeaders parses the special HTTP request headers available to push task request handlers. This function silently ignores values of the wrong format.

RetryOptions
type RetryOptions struct {
	// Number of tries/leases after which the task fails permanently and is deleted.
	// If AgeLimit is also set, both limits must be exceeded for the task to fail permanently.
	RetryLimit int32

	// Maximum time allowed since the task's first try before the task fails permanently and is deleted (only for push tasks).
	// If RetryLimit is also set, both limits must be exceeded for the task to fail permanently.
	AgeLimit time.Duration

	// Minimum time between successive tries (only for push tasks).
	MinBackoff time.Duration

	// Maximum time between successive tries (only for push tasks).
	MaxBackoff time.Duration

	// Maximum number of times to double the interval between successive tries before the intervals increase linearly (only for push tasks).
	MaxDoublings int32

	// If MaxDoublings is zero, set ApplyZeroMaxDoublings to true to override the default non-zero value.
	// Otherwise a zero MaxDoublings is ignored and the default is used.
	ApplyZeroMaxDoublings bool
}

RetryOptions let you control whether to retry a task and the backoff intervals between tries.

Task
type Task struct {
	// Path is the worker URL for the task.
	// If unset, it will default to /_ah/queue/

A Task represents a task to be executed.

func Add

Add adds the task to a named queue. An empty queue name means that the default queue will be used. Add returns an equivalent Task with defaults filled in, including setting the task's Name field to the chosen name if the original was empty.

func AddMulti

AddMulti adds multiple tasks to a named queue. An empty queue name means that the default queue will be used. AddMulti returns a slice of equivalent tasks with defaults filled in, including setting each task's Name field to the chosen name if the original was empty. If a given task is badly formed or could not be added, an appengine.MultiError is returned.

func Lease

Lease leases tasks from a queue. leaseTime is in seconds. The number of tasks fetched will be at most maxTasks.

func LeaseByTag

LeaseByTag leases tasks from a queue, grouped by tag. If tag is empty, then the returned tasks are grouped by the tag of the task with earliest ETA. leaseTime is in seconds. The number of tasks fetched will be at most maxTasks.

func NewPOSTTask

NewPOSTTask creates a Task that will POST to a path with the given form data.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-08-07 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["This package provides a client for App Engine's task queue service, enabling applications to perform work outside of user requests."],["The taskqueue service supports adding tasks, either individually via `Add` or in bulk using `AddMulti`, to a specified or default queue."],["Tasks can be managed by deleting them using `Delete` or `DeleteMulti`, modifying their lease with `ModifyLease`, or purging entire queues with `Purge`."],["Statistics about task queues, such as the number of tasks and execution metrics, can be retrieved through `QueueStats`."],["The package includes functionality for handling HTTP request headers specific to push tasks, including parsing them via `ParseRequestHeaders` and controlling retry behavior using `RetryOptions`."]]],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4