I understand the value of implementing it the way `Registry.dispatch` works,
but it makes using it a bit awkward. In the example use case I gave earlier, it
would look something like this in the coordinating process
```
handle_info(:interval, state) do
new_keys = get_keys_from_external()
Registry.all(registry, fn entries ->
current_keys = Enum.map(entries, &(elem(&1, 0))
synchronize(current_keys, new_keys)
end)
end
```
Which is okay, I guess, but the data is stuck in the callback. Also, if we copy
the way that dispatch handles partitions the code would only work if there
aren't multiple partitions. Not sure how I'd go about collecting the entries
from multiple partitions, maybe in an ETS table? Sending to myself and storing
in state? Either way, it's not very ergonomic. Maybe I'm missing an obvious
solution.
Would it make sense to implement it as a Stream? It should provide some of the
same properties as the dispatch solution. We could iterate over the tables and
handle partitions seamlessly.
--
You received this message because you are subscribed to the Google Groups
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elixir-lang-core/503ef13f-9e18-4e64-8e1c-84ca677ab504%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.