partitioner

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2025 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashFnv

func HashFnv(data *models.Job) (uint64, error)

The current implementation is really slow

Types

type Partitoner

type Partitoner[T any] struct {
	// contains filtered or unexported fields
}

func NewPartitoner

func NewPartitoner[T any](partitions uint, hashFn func(T) (uint64, error), opts ...PartitonerOption[T]) *Partitoner[T]

Partitoner factory function

func (Partitoner[T]) Examine

func (p Partitoner[T]) Examine()

func (*Partitoner[T]) PartitionData

func (p *Partitoner[T]) PartitionData(dataChannel <-chan T) []chan T

TODO: impl wg to ensure no loss of data WARNING!: There can be loss of data if the service starts to shutdown

type PartitonerOption

type PartitonerOption[T any] func(*Partitoner[T])

func WithBufferSize

func WithBufferSize[T any](size int) PartitonerOption[T]

func WithContext

func WithContext[T any](ctx context.Context) PartitonerOption[T]

func WithMaxRetries

func WithMaxRetries[T any](retries int) PartitonerOption[T]

Jump to

Keyboard shortcuts

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