PRO

Effect Scatter-Gather Quorum

Fan-out that returns on a quorum instead of waiting for the slowest shard. A search hitting 20 shards that blocks until all 20 answer is as slow as its worst shard every time; a completeness threshold returns once enough shards answer, so one straggler cannot hold the response and latency is the k-th fastest, not the slowest. A per-gather timeout returns the partial result gathered so far rather than hanging on a dead shard, and remaining shard fibers are interrupted on completion so a slow shard cannot leak a running fiber. The demo meets a 3-of-5 quorum in 16ms past two 500ms stragglers, degrades to a partial result when the quorum is impossible, and leaks no fibers. Pinned to effect 4.0.0-beta.98.

Install
npx shadcn@latest add https://ui.aryank.space/r/effect-scatter-gather-quorum.json

Installs from ui.aryank.space. To add it by hand, copy the files in Files below, or register the @compronents namespace via the docs.

Visualization
gather
3 fast shards
readonly Shard[]
wait for all 5
readonly Shard[]
Effect.all(shards) // slowest shard wins

Fanning out to 5 shards and waiting for all of them is as slow as the worst shard, every time. Two 500ms stragglers gate the whole query at 500ms while three fast shards sit idle.

Files

Dependencies