inmemqueue

package
v0.0.0-...-5d10380 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package inmemqueue provides an in-memory queue implementation that can be used for scheduling of fetch actions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InMemory

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

InMemory is a Queue implementation that schedules in-process fetch operations. Unlike the GCP task queue, it will not automatically retry tasks on failure.

This should only be used for local development.

func New

func New(ctx context.Context, workerCount int, experiments []string, processFunc InMemoryProcessFunc) *InMemory

New creates a new InMemory that asynchronously fetches from proxyClient and stores in db. It uses workerCount parallelism to execute these fetches.

func (*InMemory) ScheduleFetch

func (q *InMemory) ScheduleFetch(ctx context.Context, modulePath, version string, _ *queue.Options) (bool, error)

ScheduleFetch pushes a fetch task into the local queue to be processed asynchronously.

func (*InMemory) WaitForTesting

func (q *InMemory) WaitForTesting(ctx context.Context)

WaitForTesting waits for all queued requests to finish. It should only be used by test code.

type InMemoryProcessFunc

type InMemoryProcessFunc func(context.Context, string, string) (int, error)

Jump to

Keyboard shortcuts

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