phoenixframework / phoenix_pubsub_redis

The Redis PubSub adapter for the Phoenix framework
175 stars 66 forks source link

require node_name option #25

Closed mitchellhenke closed 7 years ago

jeregrine commented 7 years ago

Lgtm

hamiltop commented 7 years ago

I solved this on my system by providing --sname foo as an argument when launching. This was easy because each node has a different hostname, so foo@bar, foo@baz, etc. are all unique.

The solution here seems a bit more cumbersome. I guess I could just do System.get_env("HOSTNAME") to accomplish the same effect, but if the BEAM node name is set, we shouldn't have to specify it again here.

chrismccord commented 7 years ago

:shipit:

chrismccord commented 7 years ago

@hamiltop It feels odd to rely on node() being set properly when the user is not using distributed erlang, so I'm not sure how I feel about it. If we went that route in the instructions, we would at least need to detect if node() == :"nonode@nohost" and raise because we would have obvious dups

hamiltop commented 7 years ago

That's fair. BTW, https://github.com/phoenixframework/phoenix_pubsub_redis/issues/26 is opened with other presences issues.

josevalim commented 7 years ago

@chrismccord it is ok to ask for a name to be given but I would suggest using --sname and --hidden.

chrismccord commented 7 years ago

works for me. @mitchellhenke Can you amend with requiring a name, as follows:

1) first check for node(), and use the value so long as it's not :nonode@nohost, 2) next check opts[:node_name], 3) raise if both return no usuable value. Document usage of -sname as the default choice. Thanks!

mitchellhenke commented 7 years ago

Can do :) On Fri, Oct 7, 2016 at 4:16 PM Chris McCord notifications@github.com wrote:

works for me. @mitchellhenke https://github.com/mitchellhenke Can you amend with requiring a name, as follows:

1) first check for node(), and use the value so long as it's not :nonode@nohost, 2) next check opts[:node_name], 3) raise if both return no usuable value. Document usage of -sname as the default choice. Thanks!

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/phoenixframework/phoenix_pubsub_redis/pull/25#issuecomment-252363216, or mute the thread https://github.com/notifications/unsubscribe-auth/ABXTq37lZCd3zP8wwhsk4WkSOVx-IHgCks5qxra9gaJpZM4KPD_F .

mitchellhenke commented 7 years ago

@chrismccord forgot to ping after I added a commit from the feedback

chrismccord commented 7 years ago

<3 <3 <3