Skip to content

Add to_list/1 for registry iteration - #3

Merged
alii merged 1 commit into
masterfrom
to-list
Jun 10, 2026
Merged

alii merged 1 commit into
masterfrom
to-list

Conversation

@alii

@alii alii commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Mirrors gen_registry's to_list/1: returns every (key, subject) pair via a direct ets:tab2list read — no gen_server round-trip, same staleness caveat as lookup (a just-died process may linger one row until the EXIT is processed). The table is protected, so cross-process reads are already part of the access model.

reduce/3 parity falls out as to_list |> list.fold; count/sample left out until needed.

Motivation: otters/dance's cluster rebalancer currently maintains a parallel index of started keys purely because reki couldn't be iterated. With this, that bookkeeping gets deleted.

Includes tests (round-trip + dead-entry pruning) and a version bump to 1.2.0.

🤖 Generated with Claude Code

Mirrors gen_registry's to_list/1: every (key, subject) pair via a
direct ets:tab2list read — no gen_server round-trip, same staleness
caveat as lookup. Lets callers sweep the registry (rebalancing,
metrics, draining) without maintaining a parallel key index.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@alii
alii merged commit 9c1796a into master Jun 10, 2026
1 check passed
@alii
alii deleted the to-list branch June 10, 2026 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant