tasks

package
v0.0.0-...-e508dfc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 21, 2025 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Overview

Package tasks provides a Google Cloud Tasks implementation as a queue used for asynchronous scheduling of fetch actions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, m *queue.Metadata) (queue.Queue, error)

New creates a new Cloud Tasks queue.Queue based on metadata m.

Types

type Queue

type Queue struct {
	// contains filtered or unexported fields
}

Queue is a queue.Queue backed by the Google Cloud Tasks.

func (*Queue) Enqueue

func (q *Queue) Enqueue(ctx context.Context, task queue.Task, opts *queue.Options) (bool, error)

Enqueue enqueues a task in q. It returns an error if there was an error hashing the task name, or an error pushing the task to GCP. If the task was a duplicate, it returns (false, nil).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL