operationq

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

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 1 Imported by: 9

README

operationq

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

processes multiple queues in parallel

Reporting issues and requesting features

Please report all issues and feature requests in cloudfoundry/diego-release.

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