Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/v1.1.0 #8

Merged
merged 5 commits into from Jul 16, 2021
Merged

Release/v1.1.0 #8

merged 5 commits into from Jul 16, 2021

Conversation

ihumanable
Copy link
Contributor

@ihumanable ihumanable commented Jul 16, 2021

Two new features

  • Optimization for lookup_or_start
  • Multiple Registries for the same worker module via the name argument.

* Encode a common pattern as the default behavior.

It is a common pattern when using GenRegistry to wrap lookup_or_start/4
with a call to lookup/2 first.

This pattern exists because it allows the caller to do a fast ETS
lookup in the client context without having to switch to the server
context when the process is already running.

lookup_or_start/4 accepts a GenServer.server(), in the cases that a
caller uses a pid, the old path will be followed since there's no good
way to go from pid to :ets.tab().  If the caller provides an atom
(local named process) then the atom will be assumed to be the
:ets.tab() and a client-side lookup performed.

* Tests for the non-name case
@ihumanable ihumanable requested a review from birarda July 16, 2021 02:23
Copy link
Contributor

@birarda birarda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small doc corrections only. LGTM!

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
{:error, :not_found} ->
@gen_module.call(registry, {:lookup_or_start, id, args}, timeout)
end
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

ihumanable and others added 2 commits July 16, 2021 09:46
Co-authored-by: Stephen Birarda <commit@birarda.com>
Co-authored-by: Stephen Birarda <commit@birarda.com>
@ihumanable ihumanable merged commit c676531 into master Jul 16, 2021
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.

None yet

2 participants