streams

package
v0.98.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Evictor

type Evictor interface {
	Evict() identity.Stream
}

Evictors remove the "least important" stream based on some strategy such as the oldest, least active, etc.

type HashMap

type HashMap[T any] map[identity.Stream]T

func (HashMap[T]) Delete

func (m HashMap[T]) Delete(id identity.Stream)

func (HashMap[T]) Items

func (m HashMap[T]) Items() func(yield func(identity.Stream, T) bool) bool

func (HashMap[T]) Len

func (m HashMap[T]) Len() int

func (HashMap[T]) Load

func (m HashMap[T]) Load(id identity.Stream) (T, bool)

func (HashMap[T]) Store

func (m HashMap[T]) Store(id identity.Stream, v T) error

type Map

type Map[T any] interface {
	Load(identity.Stream) (T, bool)
	Store(identity.Stream, T) error
	Delete(identity.Stream)
	Items() func(yield func(identity.Stream, T) bool) bool
	Len() int
}

Map defines a collection of items tracked by a stream-id and the operations on it

type Seq

type Seq[T any] func(yield func(identity.Stream, T) bool) bool

Sequence of streams that can be iterated upon

Jump to

Keyboard shortcuts

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