You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I thought it would be nice to have a function to find pid by port name since we most likely know which port we are using. We can achieve it just by doing pattern-matching against the result of find_pids/0. What do you think?
It is nice to have but after all I did not use it in my project because I realized I could avoid starting twice for the same port at the higher layer using Registry.
Since I intended find_pids/0 as a debug tool, I think that it can be changed or extended as needed to make life easier when debugging. I was just about to say that find_pid/1 would be fine to add, but then you said that you ended up not using it. Maybe we hold off with it for now.
As a debugging tool find_pid/1 should be OK, but yeah maybe we can wait until somebody else finds it necessary.
I personally decided not to use it in my code because I got confused when I used Circuits.UART (active mode) in a GenServer. I was able to avoid the :eagain error using existing find_pids/0 but then that GenServer stopped receiving the message from the UART. Maybe I did something wrong but after all, registering my processes in my own registry was easier for me in understanding what is going on.
P.S. Maybe the issue I had above was merely because the UART process does not know about my new GenServer process 🤔
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is an idea for minor enhancement.
I thought it would be nice to have a function to find pid by port name since we most likely know which port we are using. We can achieve it just by doing pattern-matching against the result of
find_pids/0. What do you think?