title: How to get keys (pids) of registered via Register children
body: <p>I want to use <code>Registry</code> module to register dynamically created children processes. 
  So I added registry into my supervisor tree:</p>
  
  <pre><code>def init([]) do
    children = [
      supervisor(Registry, [:unique, :my_registry]),
      supervisor(MyManager, []),
      # ...
    ]
    opts = [strategy: :one_for_one, name: MySupervisor]
    supervise(children, opts)
  end
  </code></pre>
  
  <p>Registration of children happens like this:</p>
  
  <pre><code>def start_link(%{id: id}) do
    GenServer.start_link(__MODULE__, [], name: {:via, Registry, {:my_registry, id}})
  end
  </code></pre>
  
  <p>So, my questions is – how to get all keys (children pids) in my Registry.
  I tried to use <code>Registry.keys\2</code>, but without success.</p>
  
  <pre><code>def get_registry_pid do
    Supervisor.which_children(MySupervisor)
    |&gt; Enum.filter(fn {id, _, _, _} -&gt; id == Registry end)
    |&gt; List.first
    |&gt; elem(1) # get a Regisry pid from a tuple {id, pid, type, modules}
  end
  Registry.keys(:my_registry, get_registry_pid()) # returns []
  # but 
  Registry.lookup(:my_registry, id) # returns PID as expected
  </code></pre>
  
  <p>Thanks in advance for any help!</p>