aqm

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

README

aqm

import "github.com/ccheers/xpkg/container/queue/aqm"

Index

Variables

var ErrLimitExceed = fmt.Errorf("limit exceed")

type Config

Config codel config.

type Config struct {
    Target         int64 // target queue delay (default 20 ms).
    Internal       int64 // sliding minimum time window width (default 500 ms)
    MaxOutstanding int64 // max num of concurrent acquires
}

type Queue

Queue queue is CoDel req buffer queue.

type Queue struct {
    // contains filtered or unexported fields
}
func Default
func Default() *Queue

Default new a default codel queue.

func New
func New(conf *Config) *Queue

New new codel queue.

func (*Queue) Pop
func (q *Queue) Pop()

Pop req from CoDel request buffer queue.

func (*Queue) Push
func (q *Queue) Push(ctx context.Context) (err error)

Push req into CoDel request buffer queue. if return error is nil,the caller must call q.Done() after finish request handling

func (*Queue) Reload
func (q *Queue) Reload(c *Config)

Reload set queue config.

func (*Queue) Stat
func (q *Queue) Stat() Stat

Stat return the statistics of codel

type Stat

Stat is the Statistics of codel.

type Stat struct {
    Dropping bool
    FaTime   int64
    DropNext int64
    Packets  int
}

Generated by gomarkdoc

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrLimitExceed = fmt.Errorf("limit exceed")

Functions

This section is empty.

Types

type Config

type Config struct {
	Target         int64 // target queue delay (default 20 ms).
	Internal       int64 // sliding minimum time window width (default 500 ms)
	MaxOutstanding int64 // max num of concurrent acquires
}

Config codel config.

type Queue

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

Queue queue is CoDel req buffer queue.

func Default

func Default() *Queue

Default new a default codel queue.

func New

func New(conf *Config) *Queue

New new codel queue.

func (*Queue) Pop

func (q *Queue) Pop()

Pop req from CoDel request buffer queue.

func (*Queue) Push

func (q *Queue) Push(ctx context.Context) (err error)

Push req into CoDel request buffer queue. if return error is nil,the caller must call q.Done() after finish request handling

func (*Queue) Reload

func (q *Queue) Reload(c *Config)

Reload set queue config.

func (*Queue) Stat

func (q *Queue) Stat() Stat

Stat return the statistics of codel

type Stat

type Stat struct {
	Dropping bool
	FaTime   int64
	DropNext int64
	Packets  int
}

Stat is the Statistics of codel.

Jump to

Keyboard shortcuts

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