hyperqueue

package
v0.11.115 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package hyperqueue provides a sharded WorkqueueService implementation that consistently distributes keys across N backend workqueue services using consistent hashing.

Hyperqueue acts as a transparent router that implements the WorkqueueService gRPC interface. It takes a slice of backend WorkqueueServiceClients and routes incoming requests to the appropriate shard based on the request key.

Keys are assigned to shards using FNV-1a hashing:

hash(key) % len(backends) -> shard index

This ensures:

  • Deterministic routing: the same key always routes to the same shard
  • Even distribution: keys are roughly evenly distributed across shards
  • Fast computation: FNV-1a is a fast non-cryptographic hash

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

New creates a sharded WorkqueueServiceServer from the provided backend clients. The shard count is determined by len(backends). Keys are consistently routed to shards using hash(key) % len(backends).

Example

ExampleNew demonstrates creating a hyperqueue server from a set of backend WorkqueueServiceClient instances.

package main

import (
	"fmt"

	"chainguard.dev/driftlessaf/workqueue/hyperqueue"
)

func main() {
	// In production, pass real gRPC clients connected to backend workqueue
	// services. New returns an error if no backends are provided.
	_, err := hyperqueue.New(nil)
	fmt.Println("error with no backends:", err)
}
Output:
error with no backends: at least one backend is required

Types

This section is empty.

Jump to

Keyboard shortcuts

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