Reputation: 3
In elixir, if I invoke spawn to create a process but didn't store the process instance to a variable, how can I retrieve the instance of that PID again?
I know I can use Process.list() which will return all the processes running in the current node but is there a way to retrieve the instance of a specific PID?
Upvotes: 0
Views: 844
Reputation: 564
The easiest way would be set a name for the process and retrieve it using Process.whereis/1.
Upvotes: 1