<html><body style="font-family: Helvetica,Arial,sans-serif; font-size: 12px;"><br>The
following patch appears to do what I want. Perhaps those familiar with
discount internals could confirm its correctness or suggest and
alternative approach which doesn't require a patch.<div><br></div><div><br></div><div>dispcount_watcher.erl<br></div><div><br></div><div> ...</div><div><span class="pl-k"><span class="pl-en"> init</span>(<span class="pl-smi">Id</span>,<span class="pl-smi">Conf</span>,<span class="pl-smi">M</span>,<span class="pl-smi">A</span>) -></span></div><div><span class="pl-k"> - case</span> <span class="pl-smi">M</span>:<span class="pl-en">init</span>(<span class="pl-smi">A</span>) <span class="pl-k">of</span><span class="pl-k"><br></span></div><div><span class="pl-k"> + case</span> <span class="pl-smi">M</span>:<span class="pl-en">init</span>(<span class="pl-smi">Id, A</span>) <span class="pl-k">of<br> ...<br></span></div><div><span class="pl-k"><br></span></div><div>dispcount.erl</div><div><br></div><div><span class="pl-k"> ...<br></span></div><div> behaviour_info(callbacks) -><br></div><div> - [{init,1},</div><div> + [{init,2},<br></div><span class="pl-k"> ...<br></span><div><span class="pl-k"><br></span></div><div><span class="pl-k"><br></span></div><span class="pl-k">- Edmond -</span><br><br><blockquote class="atmailquote"><br>----- Original Message -----<br><div id="origionalMessageFromField" style="width:100%;display:inline;background:rgb(228,228,228);"><div style="display:inline;font-weight:bold;">From:</div> <erlang-questions@erlang.org></div><br><div id="origionalMessageToField" style="display:inline;font-weight:bold;">To:</div>"Edmond Begumisa" <ebegumisa@hysteria-tech.com><br><div id="origionalMessageSentField" style="display:inline;font-weight:bold;">Cc:<span id="msgReply"></span><div id="back_button" class="sendEmail">
<a href="http://webmail.hysteria-tech.com/#"><span class="stronglastword">Send my <strong>Reply</strong></span></a>
</div></div><br><div style="display:inline;font-weight:bold;">Sent:</div>Thu, 19 Jul 2018 07:53:06 +1000<br><div id="origionalMessageSubjectField" style="display:inline;font-weight:bold;">Subject:</div>Dispcount resource identification during init<br><br><br>
Hello all,<br><br>
Any dispcount[1] users out there? Your assistance on two questions would <br>
be appreciated..<br><br>
a) During init function of the callback module implementing the dispcount <br>
behaviour, I would like to know resource number assigned to that process. <br>
Is this possible?<br><br>
The reason is: each of my resources (port programs) need to be initialised <br>
to use separate directories for storage. For example: "priv/rc1/data", <br>
"priv/rc2/data", etc. If the dispcount sup restarts resource 1 for <br>
instance, I would like resource 1 to always use "priv/rc1/data". There <br>
should be no possibility two or more resources ending up being initialised <br>
to the same dir due to sup restarts.<br><br>
The identifier doesn't have to be a number. But if the node/machine <br>
restarts, the same directories should be used.<br><br>
b) Is this library still active? One feature mentioned on the todo list <br>
would be nice to have for our purposes (dynamically growing/shrinking the <br>
number of resources).<br><br>
Thanks in advance.<br><br>
- Edmond -<br><br>
[1] https://github.com/ferd/dispcount<br><br>
-- <br>
Using Opera's mail client: http://www.opera.com/mail/ </blockquote></body></html>