Hi Scott, Thanks for the proposal.
We already have a function that returns what you want as a list, called Registry.match/3, so I would suggest to stay with a similar name. The other thing to have in mind is that the stream would only be useful if you have more than one partition, so for all other cases, we can't even return a stream. So I see two options: 1. Introduce Registry.stream_match/2 which may return a stream - and therefore may be awkward 2. Introduce a stream: true option to Registry.match which may return a stream if applicable - behaving like an optimization in a way Thoughts? On Wed, Sep 30, 2020 at 8:38 PM Scott Southworth <[email protected]> wrote: > Hi, this is my first Elixir suggestion! > > For using Registry as an in-memory database that's tied to many actor > processes, it would be nice to be able to stream selections to perform > batch operations without loading large amounts of data into memory all at > once. > > I propose adding a Registry.select/3 that would look like: > > `select(registry <https://hexdocs.pm/elixir/Registry.html#t:registry/0>(), > spec <https://hexdocs.pm/elixir/Registry.html#t:spec/0>(), limit :: > pos_integer()) :: Stream.t()` > > The limit argument would provide an `:ets` select limit (as this would > affect the granularity of our memory consumption). The implementation would > return a stream that could return data across the underlying partitions > transparently. > > Thanks, > Scott Southworth > > > > > -- > 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/5aac28b9-2809-49f9-80b4-bae6de7d9df3n%40googlegroups.com > <https://groups.google.com/d/msgid/elixir-lang-core/5aac28b9-2809-49f9-80b4-bae6de7d9df3n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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/CAGnRm4Kw6CmpiRbT%2BeaqaAd6SNK%2B1JV8QeLKVwFRsS2%2Bc_JumA%40mail.gmail.com.
