syncqueues

package
v0.5.12 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const CName = "common.util.syncqueues"

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionPool

type ActionPool interface {
	Run()
	Add(peerId, objectId string, action func(ctx context.Context), remove func())
	Close()
}

func NewActionPool

func NewActionPool(closePeriod, gcPeriod time.Duration, openFunc func(peerId string) *replaceableQueue) ActionPool

type Guard

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

func NewGuard

func NewGuard() *Guard

func (*Guard) Release

func (g *Guard) Release(id string)

func (*Guard) TryTake

func (g *Guard) TryTake(id string) bool

type Limit

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

func NewLimit

func NewLimit(peerStep, totalStep []int, excludeIds []string, excludedLimit int) *Limit

func (*Limit) Release

func (l *Limit) Release(id string)

func (*Limit) Stats

func (l *Limit) Stats(id string) string

func (*Limit) Take

func (l *Limit) Take(id string) bool

type SyncQueues

type SyncQueues interface {
	app.ComponentRunnable
	ActionPool(spaceId string) ActionPool
	Limit(spaceId string) *Limit
}

func New

func New() SyncQueues

Jump to

Keyboard shortcuts

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