queue

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package queue implements consistent shard routing for Asynx commands.

Router uses FNV-1a hash to deterministically route aggregates to shards. The same aggregateID always hashes to the same shard, ensuring commands for the same aggregate are processed serially by that shard's dispatcher.

  • Hash function — FNV-1a 64-bit; portable and fast
  • Modulo mapping — hash % numShards yields shard index [0, numShards)

Router is stateless; Create/Read/Update/Delete operations never collide as long as numShards remains constant. Resharding is out of scope.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Router

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

func New

func New(numShards int) *Router

func (*Router) Route

func (r *Router) Route(aggregateID string) int

Jump to

Keyboard shortcuts

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