phoenixframework / phoenix_pubsub

Distributed PubSub and Presence platform for the Phoenix Framework
http://www.phoenixframework.org/
MIT License
653 stars 124 forks source link

[Get By Key] get by key with limits #180

Closed PranavVadrevu closed 11 months ago

chrismccord commented 11 months ago

Can we get a rundown on the rationale and needs for this feature? The issue with opening up the lookup interfaces is we are rather tied to what we can do inside ets in the future. It may be fine, but it's something we need to be careful with, so I'd like to know more about what specifically you are needing. Thanks!

PranavVadrevu commented 11 months ago

Can we get a rundown on the rationale and needs for this feature? The issue with opening up the lookup interfaces is we are rather tied to what we can do inside ets in the future. It may be fine, but it's something we need to be careful with, so I'd like to know more about what specifically you are needing. Thanks!

Hey @chrismccord, I'm sorry - I meant to push to our custom fork of the repo, didn't mean to get this PR in the main Phoenix Framework, sorry about that 😅

indrekj commented 11 months ago

@PranavVadrevu may be useful for you: https://github.com/phoenixframework/phoenix_pubsub/pull/127 We've been using this for a long time now.

PranavVadrevu commented 11 months ago

@PranavVadrevu may be useful for you: #127 We've been using this for a long time now.

Thanks a lot @indrekj, it looks like it should definitely help!

PranavVadrevu commented 11 months ago

Tiny question @indrekj, did you do a performance comparison between dirty_list and your solution? If the main optimization to be made is to remove the Genserver blocking call (which dirty_list also does), wondering if this solution adds more efficiency (if we don't care whether the list is dirty or not)

indrekj commented 11 months ago

I don't remember exactly anymore. It's been almost 5 years :). I think our main goal was to improve performance while keeping the existing guarantees and interface. The GenServer part was the major blocker. An extra call to down_replicas ets which is generally very small is likely a very minor optimization.

PranavVadrevu commented 11 months ago

I see, that's great to know, thank you!