dispatch

package
v0.0.0-...-1fb8944 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CoalescingDispatcher

type CoalescingDispatcher interface {
	CoalescingDispatch(key1, key2 string, n int) []string
	MaxBits() int
}

CoalescingDispatcher selects a destination based on the first n bits of each key in a key pair.

For any given CoalescingDispatcher state, the destination chosen for a given pair of keys at a given bit depth will be stable.

For any given CoalescingDispatcher state, the destination chosen for with n equal to zero will be stable, regardless of the values of the keys.

func Coalesce

func Coalesce(d Dispatcher) CoalescingDispatcher

Coalesce returns a CoalescingDispatcher for a given Dispatcher.

type Dispatcher

type Dispatcher interface {
	Dispatch(i uint64) []string
	Len() int
}

Dispatcher selects destinations for a given value i.

For any given Dispatcher state, the destinations chosen for a given value of i will be stable.

type StringDispatcher

type StringDispatcher interface {
	Dispatcher
	DispatchString(s string) []string
}

func ByString

func ByString(d Dispatcher) StringDispatcher

Jump to

Keyboard shortcuts

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