<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On 29 May 2014, at 15:32, Ulf Wiger <<a href="mailto:ulf@wiger.net">ulf@wiger.net</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>Have you looked at gproc_monitor:subscribe/1. Supposedly it does what you want.</div></div></blockquote><div><br></div><div>Ahhh, beautiful this is exactly what I need.</div><div>Read the fine documentation they say...</div><div><br></div><div>Thanks Ulf.</div><div><br></div><div>Cam</div><div><br></div><div><br></div><div><br></div><div><br></div><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><div>On 29 May 2014, at 14:09, Camille Troillard <<a href="mailto:lists@tuli.pe">lists@tuli.pe</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hello Ulf,<div><br></div><div><br class=""><div><div class="">On 29 May 2014, at 10:33, Ulf Wiger <<a href="mailto:ulf@wiger.net">ulf@wiger.net</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr" class="">In this sense, gproc:monitor/2 works like erlang:monitor/2, which also stays silent if the object is alive and well.</div></blockquote><div><br class=""></div><div>That makes sense.</div><div><br class=""></div><br class=""><blockquote type="cite"><div dir="ltr" class=""><div class="">Perhaps the easiest thing to do is to simply look up the name right after calling monitor()?</div></div></blockquote><div><br class=""></div><div>Yes I could do that, though I wished I only had a single place where I act on the registration notifications.</div><div><br></div><div>So I could use nb_wait, but there is a small discrepancy where its callback signature <i>{gproc, Ref, registered, {Key, Pid, Value}} </i>is not the same as the one of monitor<i> {gproc, registered, Ref, Key}. </i>Maybe there was a good reason for this, unfortunately this prevents me from having a unified notification of a process coming up.</div><div><br></div><div><br></div><div>Thank you.</div><div>Cam</div><div><br class=""></div><div><br class=""></div><blockquote type="cite"><div class="gmail_extra"><div class="gmail_quote">2014-05-28 18:04 GMT+02:00 Camille Troillard <span dir="ltr" class=""><<a href="mailto:lists@tuli.pe" target="_blank" class="">lists@tuli.pe</a>></span>:<br class="">
<blockquote style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto;" class="gmail_quote">OK, so it seems gproc:monitor(Key, follow) works, however if the name is already registered the message {gproc, registered, Ref, Key} is not sent. I would have expected the message to be sent since {gproc, unreg, Ref, Key} is sent when the name is not registered. Is this a bug?<br class="">

<div class="HOEnZb"><div class="h5"><br class="">
<br class="">
On 28 May 2014, at 17:15, Camille Troillard <<a href="mailto:lists@tuli.pe" class="">lists@tuli.pe</a>> wrote:<br class="">
<br class="">
> Hello,<br class="">
><br class="">
> I would like to take action when a name gets registered under gproc.<br class="">
><br class="">
> I understood I could call gproc:monitor(Key, follow) during initialization but my process does not get notified of the name availability. Therefore I had to replace that call to gproc:nb_wait, and then monitor the process in the callback handler. I wish I could follow the former approach.<br class="">

><br class="">
> Can someone explain the usage pattern of gproc:monitor(_, follow)?<br class="">
> I am trying to understand why this would not work.<br class="">
> Thanks!<br class="">
><br class="">
> Camille<br class="">
> _______________________________________________<br class="">
> erlang-questions mailing list<br class="">
> <a href="mailto:erlang-questions@erlang.org" class="">erlang-questions@erlang.org</a><br class="">
> <a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank" class="">http://erlang.org/mailman/listinfo/erlang-questions</a><br class="">
<br class="">
_______________________________________________<br class="">
erlang-questions mailing list<br class="">
<a href="mailto:erlang-questions@erlang.org" class="">erlang-questions@erlang.org</a><br class="">
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank" class="">http://erlang.org/mailman/listinfo/erlang-questions</a><br class="">
</div></div></blockquote></div><br class=""></div>
</blockquote></div><br class=""></div></div>_______________________________________________<br>erlang-questions mailing list<br><a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br><a href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a><br></blockquote></div><br></div></blockquote></div><br></body></html>