Update dynamic-supervisor.markdown
mattjg908 opened this issue · 2 comments
In the elixir-lang.org docs here, the KV.Supervisor's init is updated to be:
def init(:ok) do
children = [
{DynamicSupervisor, name: KV.BucketSupervisor, strategy: :one_for_one},
{KV.Registry, name: KV.Registry}
]
Supervisor.init(children, strategy: :one_for_all)
end
Since we have now changed our registry to use KV.BucketSupervisor, which is registered globally
I believe the text above uses the term "globally" a little loosely because init does not register KV.BucketSupervisor globally, it registers it locally.
I think the intention was to say something more along the lines of "Since we have now changed our registry to use KV.BucketSupervisor, which is registered locally and can now be referenced by the name KV.BucketSupervisor,.." or something along those lines.
Perhaps the text could/should be updated to be:
Since we have now changed our registry to use KV.BucketSupervisor, our tests are now relying on this shared supervisor even though each test has its own registry. The question is: should we?
Any thoughts?
Yes, good catch! Please send a PR!
Yes, good catch! Please send a PR!
Great, I will do so! :)