gstream

package
v2.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatcherFunc

type BatcherFunc[S, D any] func(t []S) (D, error)

type DynamicSizeCache

type DynamicSizeCache[T Sizable, M any] struct {
	// contains filtered or unexported fields
}

func NewDynamicSizeCache

func NewDynamicSizeCache[T Sizable, M any](s WStream[M], maxSize int, bf BatcherFunc[T, *M]) *DynamicSizeCache[T, M]

func (*DynamicSizeCache[T, M]) Context

func (d *DynamicSizeCache[T, M]) Context() context.Context

func (*DynamicSizeCache[T, M]) Flush

func (d *DynamicSizeCache[T, M]) Flush() error

func (*DynamicSizeCache[T, M]) Queue

func (d *DynamicSizeCache[T, M]) Queue(ts ...T) error

type RStream

type RStream[T any] interface {
	Recv() (*T, error)
	Context() context.Context
}

type Sizable

type Sizable interface {
	EstimateSize() int
}

type WStream

type WStream[T any] interface {
	Send(*T) error
	Context() context.Context
}

func Wrap

func Wrap[In, Out any](original WStream[Out], mapper func(*In) *Out) WStream[In]

Jump to

Keyboard shortcuts

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