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 found that the name was rewritten when starting a Fount by this function. What do you think about removing it? When it's here it requires more work to retrieve the sup using its name. Thoughts?
The text was updated successfully, but these errors were encountered:
Not sure I follow your comment. When you do cxy_fount_sup:start_link and you supply a name, you are providing a name for the cxy_fount. I use FOUNT_NAME_sup as the name of the supervisor, FOUNT_NAME as the name of the cxy_fount gen_fsm.
I did it that way because the interface is to the cxy_fount. The only case for using the supervisor is to get the cxy_fount instance (when it has no name), or to get the cxy_regulator instance (which should be very rare). cxy_fount_sup:start_link returns {ok, Pid} so you can just use the Pid instead of the name. When in a supervisor hierarchy, it just gets wired in normally.
What are you doing that requires you to need the supervisor instance by name? If you do need it, I've just gone with the convention that for cxy_fount 'socket_fount' it is 'socket_fount_sup' (i.e., just append '_sup' on the end of your cxy_fount name to get the supervisor to kill it or something). Generally, I expected people naming the founts to just have hard-coded atoms in their code, so they will just hard-code xxxx_sup as well if they need to access it.
Hi,
I found that the name was rewritten when starting a Fount by this function. What do you think about removing it? When it's here it requires more work to retrieve the sup using its name. Thoughts?
The text was updated successfully, but these errors were encountered: