Wayfarer.Target.Selector (wayfarer v0.6.2)

View Source

Given a list of targets and an algorithm decide which target the request should be forwarded to.

Summary

Types

The algorithm used to select which target to forward requests to (when there is more than one matching target).

Functions

Tries to choose a target from the list of targets to send the request to based on the chosen algorithm.

A guard for testing if an algorithm is supported.

Types

algorithm()

@type algorithm() :: :least_connections | :random | :round_robin | :sticky

The algorithm used to select which target to forward requests to (when there is more than one matching target).

Functions

choose(conn, targets, arg3)

Tries to choose a target from the list of targets to send the request to based on the chosen algorithm.

is_algorithm(algorithm)

(macro)
@spec is_algorithm(any()) :: Macro.output()

A guard for testing if an algorithm is supported.