operationq

package module
v0.0.0-...-ce3c8a0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

README

Operationq

Operationq processes multiple queues in parallel.

[!NOTE]

This repository should be imported as code.cloudfoundry.org/operationq.

Contributing

See the Contributing.md for more information on how to contribute.

Working Group Charter

This repository is maintained by App Runtime Platform under Diego area.

[!IMPORTANT]

Content in this file is managed by the CI task sync-readme and is generated by CI following a convention.

Documentation

Overview

a parallel operation queue.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Operation

type Operation interface {
	// Identifier for the operation's queue. Operations with the same key will be
	// executed in the order in which they were pushed. Operations with different
	// keys will be executed concurrently.
	Key() string

	// Work to execute when the operation is popped off of the queue.
	Execute()
}

The Operation interface is implemented externally, by the user of the queue.

type Queue

type Queue interface {
	// Enqueue an operation for execution.
	Push(Operation)
}

Queue executes operations, parallelized by operation key.

func NewSlidingQueue

func NewSlidingQueue(capacity int) Queue

NewSlidingQueue returns a queue that will buffer up to `capacity` operations per key. When capacity is exceeded, older operations are dequeued to make room.

Directories

Path Synopsis
This file was generated by counterfeiter
This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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