<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>Just as an aside, gproc now has extended monitoring functionality:</div><div><a href="https://github.com/uwiger/gproc/blob/master/doc/gproc.md#type-monitor_type">https://github.com/uwiger/gproc/blob/master/doc/gproc.md#type-monitor_type</a></div><div><br></div><div>monitor(Key::key(), Type::monitor_type()) -> reference()<br><br class="Apple-interchange-newline">monitor_type() = info | standby | follow<br><br>monitor a registered name monitor(Key, info) works much like erlang:monitor(process, Pid), but monitors a unique name registered via gproc. A message, {gproc, unreg, Ref, Key} will be sent to the requesting process, if the name is unregistered or the registered process dies. If there is a standby monitor (see below), a message {gproc, {failover, ToPid}, Ref, Key} is sent to all monitors. If the name is passed to another process using give_away/2, the event {gproc, {migrated, ToPid}, Ref, Key} is sent to all monitors.<br><br>monitor(Key, standby) sets up the monitoring process as a standby for the registered name. If the registered process dies, the first standby process inherits the name, and a message {gproc, {failover, ToPid}, Ref, Key} is sent to all monitors, including the one that inherited the name.<br><br>If the name is not yet registered, the unreg event is sent immediately. If the calling process in this case tried to start a standby monitoring, it receives the registered name and the failover event immediately.<br><br>monitor(Key, follow) keeps monitoring the registered name even if it is temporarily unregistered. The messages received are the same as for the other monitor types, but {gproc, registered, Ref, Key} is also sent when a new process registers the name.</div><div><br></div><div>BR,</div><div>Ulf W</div><br><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div><div>Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc.</div><div><a href="http://feuerlabs.com">http://feuerlabs.com</a></div></div><div><br></div></span><br class="Apple-interchange-newline">
</div>
<br></body></html>