workpool

package
v0.0.0-...-e87e1d8 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBlockNotExists = errors.New("no such block in the work pool")
)

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Timestamp int64
	Value     interface{}
}

type ExpirableMap

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

func NewExpirableMap

func NewExpirableMap(l int, expire func(time.Time, *Entry) bool) (m *ExpirableMap)

func (*ExpirableMap) Get

func (m *ExpirableMap) Get(k string) (v interface{}, ok bool)

func (*ExpirableMap) Len

func (m *ExpirableMap) Len() int

func (*ExpirableMap) Put

func (m *ExpirableMap) Put(k string, v interface{})

type WorkPool

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

func GetWorkerPool

func GetWorkerPool() *WorkPool

func (*WorkPool) Get

func (wp *WorkPool) Get(k string) (any, error)

func (*WorkPool) Put

func (wp *WorkPool) Put(k string, v any)

Jump to

Keyboard shortcuts

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