gpr

gpr

keys distribution between processes

Hi. I have the following task:
I have a server, which support subscription to different topics. One connection supports subscription for up to some limited number of topics, say 1000. I want to subscribe to, say, up to 10000 topics, so I use pool of up to 10 connections. Connections can fail and be restarted. The task is to distribute topics between connections and I would like to avoid manual tracking of which topic belongs to which connection. If number of subscribed topics is low, I would like to migrate topics between connections and shutdown some connections.

If I abstract from topics/connections, task sounds like distributing keys (topics) between processes with some configuration of limits, migration strategy, etc. I’m doing it manually now, but code is more complex than I wanted it to be, and I’m wondering, if there are some libraries in erlang/elixir which support such key distribution algorithms.
ANy suggestions are welcome.

First Post!

dmitrykleymenov

dmitrykleymenov

I’m not completely sure what you mean, but if i’ve understood correctly, consistent hashing is what you need. If so, this may help.

Where Next?

Popular in Questions Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New

Other popular topics Top

grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 54092 488
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 31525 112
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 44608 311
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New

We're in Beta

About us Mission Statement