inflight

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultEntryTTL = 10 * time.Minute
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Idempotent

type Idempotent interface {
	String() string
}

type InFlight

type InFlight interface {
	// Get returns true when the key already exists.
	Get(entry Idempotent) bool

	// Insert inserts the entry to the current list of in-flight requests.
	// Returns false when the key already exists.
	Insert(entry Idempotent) bool

	// Delete removes the entry from the in-flight entries map.
	// It doesn't return anything, and will do nothing if the specified key doesn't exist.
	Delete(entry Idempotent)
}

InFlight helps to manage in-flight requests.

type InFlightTTL

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

func NewWithTTL

func NewWithTTL() *InFlightTTL

func (*InFlightTTL) Delete

func (db *InFlightTTL) Delete(entry Idempotent)

func (*InFlightTTL) Get

func (db *InFlightTTL) Get(entry Idempotent) bool

func (*InFlightTTL) Insert

func (db *InFlightTTL) Insert(entry Idempotent) bool

type NowFunc

type NowFunc func() time.Time

Jump to

Keyboard shortcuts

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