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 ¶
WaitForTesting waits for all queued requests to finish. It should only be used by test code.