Skip to content

Commit

Permalink
Fix: ProcDict - allow looking up processes by atoms
Browse files Browse the repository at this point in the history
  • Loading branch information
mindreframer committed Jan 3, 2024
1 parent 0062327 commit 367f807
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/maxo_adapt/proc_dict.ex
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ defmodule MaxoAdapt.ProcDict do
get_dict(pid) |> get(key)
end

defp get_dict(atom) when is_atom(atom) do
get_dict(Process.whereis(atom))
end

defp get_dict(pid) do
Process.info(pid, :dictionary) |> elem(1)
end
Expand Down

0 comments on commit 367f807

Please sign in to comment.