roundrobin

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

README

Round Robin Fairness Policy

Type: round-robin-fairness-policy

The Round Robin fairness policy selects a queue from a priority band using a simple round-robin strategy. It cycles through active flows one by one, guaranteeing that no single flow can starve others, regardless of its volume, directly addressing the Noisy Neighbor problem described in the user guide.

What it does

  1. State Management: It maintains a mutable cursor (roundRobinCursor) for each Priority Band it governs, storing the last selected flow key.
  2. Determinism: Flow keys are sorted deterministically before selection.
  3. Work Conserving: It skips empty queues and only selects from flows that have pending items.

Unit of Fairness

Dispatch Attempts (Turns). Each active flow is given an equal opportunity to dispatch a request in a cyclic order.

Inputs consumed

This policy consumes structural data from the flow control system:

  • Flow Keys: Reads the set of active flow keys from the PriorityBandAccessor.
  • Queue State: Inspects the length of queues to skip empty ones.
  • Cursor State: Reads and updates the cursor stored on the priority band.

Configuration

This policy does not require any additional configuration parameters beyond its type registration.

fairnessPolicyRef: round-robin-fairness-policy

Trade-offs

  • Global Ordering Violation: It breaks strict global ordering (as defined by the OrderingPolicy) across flows. An item in a flow might be served before a 'better' item in another flow depending on the cursor position.
  • Fair Isolation: Guarantees that no single flow can starve others.

Documentation

Overview

Package roundrobin implements a fairness policy that selects queues from a priority band using a round-robin strategy, cycling through active flows one by one to guarantee that no single flow can starve others.

For detailed documentation, see README.md.

Index

Constants

View Source
const RoundRobinFairnessPolicyType = "round-robin-fairness-policy"

RoundRobinFairnessPolicyType is the registration type for the round-robin fairness policy.

Variables

This section is empty.

Functions

func RoundRobinFairnessPolicyFactory

func RoundRobinFairnessPolicyFactory(name string, _ *json.Decoder, _ fwkplugin.Handle) (fwkplugin.Plugin, error)

RoundRobinFairnessPolicyFactory is the factory function for the round-robin fairness policy.

Types

This section is empty.

Jump to

Keyboard shortcuts

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