<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="14514" data-post-id="14514">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sribe" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sribe
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="ajay" data-post="11" data-topic="603" data-full="true">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/a/f4b2a3/48.png" class="avatar"> ajay:</div>
<blockquote>
<p>One example might be about a process that sleeps for some time and then wake up(timeout ) and collect data from external interface and send it to some external server and then again go to sleep again.</p>
</blockquote>
</aside>
<p>You can use GenServer &amp; send_after for this, not complex at all, and still allows for other events to be received &amp; handled asynchronously should that ever be needed.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="14514" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/when-to-use-otp-vs-bare-processes/603/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-14514" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="14514"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="38325" data-post-id="38325">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kexoth" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kexoth/120/2982_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kexoth
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Correct me if I’m wrong, but some libraries require creation of non-OTP processes, such as <a href="https://github.com/edgurgel/httpoison#async-requests" rel="noopener nofollow ugc"><code>HTTPoison</code></a>’s &amp; <a href="https://github.com/myfreeweb/httpotion#asynchronous-requests" rel="noopener nofollow ugc">HTTPotion</a>’s support for streaming.</p>
<p>I was searching for a way to create an OTP-like process which will function well even if I make a receive loop &amp; I found here <a class="mention" href="/u/fishcakez" rel="nofollow">@fishcakez</a>’s <code>Core</code> library which he actually never used, but I will <img src="https://forum.elixirforum.com/images/emoji/apple/laughing.png?v=15" title=":laughing:" class="emoji" alt=":laughing:" loading="lazy" width="20" height="20"></p>
<p>EDIT: Unfortunately the library is quite outdated, so I ended up using <code>Task</code>. <img src="https://forum.elixirforum.com/images/emoji/apple/confused.png?v=15" title=":confused:" class="emoji" alt=":confused:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="38325" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/when-to-use-otp-vs-bare-processes/603/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-38325" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="38325"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="38359" data-post-id="38359">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Crowdhailer" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Crowdhailer/120/2438_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Crowdhailer
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Raxx</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group quote-modified" data-username="dom" data-post="10" data-topic="603">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dom/48/9313_2.png" class="avatar"> dom:</div>
<blockquote>
<p><a href="http://ninenines.eu/talks/beyond-otp/beyond-otp.html" class="inline-onebox" rel="noopener nofollow ugc">Beyond OTP</a></p>
</blockquote>
</aside>
<p>I was going through this slide show. Does anyone know if there is a video for this talk? Also do people agree with the usecase that a supervisor + some state management is a good example for a special process.</p>
<p>I’m thinking of using a special process to solve this issue here <a href="https://stackoverflow.com/questions/44663817/how-to-reference-previously-started-processes-in-an-elixir-supervisor/44663920" rel="noopener nofollow ugc">https://stackoverflow.com/questions/44663817/how-to-reference-previously-started-processes-in-an-elixir-supervisor/44663920</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="38359" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/when-to-use-otp-vs-bare-processes/603/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-38359" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="38359"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #13"></div>
  </section>
</div>
    <div class="postbit" id="38362" data-post-id="38362">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sasajuric" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sasajuric/120/991_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sasajuric
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Author of Elixir In Action</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="Crowdhailer" data-post="14" data-topic="603">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/crowdhailer/48/2438_2.png" class="avatar"> Crowdhailer:</div>
<blockquote>
<p>Also do people agree with the usecase that a supervisor + some state management is a good example for a special process.</p>
</blockquote>
</aside>
<p>You could also use a GenServer for that.</p>
<aside class="quote no-group" data-username="Crowdhailer" data-post="14" data-topic="603">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/crowdhailer/48/2438_2.png" class="avatar"> Crowdhailer:</div>
<blockquote>
<p>I’m thinking of using a special process to solve this issue here <a href="https://stackoverflow.com/questions/44663817/how-to-reference-previously-started-processes-in-an-elixir-supervisor/44663920" rel="noopener nofollow ugc">https://stackoverflow.com/questions/44663817/how-to-reference-previously-started-processes-in-an-elixir-supervisor/44663920</a></p>
</blockquote>
</aside>
<p>You could use <a href="https://hexdocs.pm/elixir/Supervisor.html#which_children/1" rel="noopener nofollow ugc">Supervisor.which_children</a> in the second child to ask the parent about the children, and then find the pid of the sibling you’re interested in.</p>
<p>However, you can’t do this in <code>init/1</code>, since you’ll deadlock, so you need to postpone this for after init. The second child can send itself a message (e.g. <code>:post_init</code>), and then in the corresponding <code>handle_info</code> ask its parent about the children, find the desired sibling, and store the pid in its own state. It’s a bit tricky, but does the job.</p>
<p>Make sure to use <code>rest_for_one</code> or <code>one_for_all</code> supervision strategy, or otherwise you might end up with a dangling reference to a non-existing process.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="38362" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/when-to-use-otp-vs-bare-processes/603/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-38362" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="38362"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #14"></div>
  </section>
</div>
    <div class="postbit" id="38364" data-post-id="38364">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Crowdhailer" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Crowdhailer/120/2438_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Crowdhailer
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Raxx</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="sasajuric" data-post="15" data-topic="603">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sasajuric/48/991_2.png" class="avatar"> sasajuric:</div>
<blockquote>
<p>You could use Supervisor.which_children in the second child to ask the parent about the children, and then find the pid of the sibling you’re interested in.</p>
</blockquote>
</aside>
<p>Do all OTP processes have a reference to their parent? if so then that is something I have missed and sounds a helpful solution. Although It still seams messy to have a process know about the structure of a supervision tree it is in. In essence I am having to change the structure of a child after adding it to a supervision tree</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="38364" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/when-to-use-otp-vs-bare-processes/603/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-38364" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="38364"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #15"></div>
  </section>
</div>
    <div class="postbit" id="38367" data-post-id="38367">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sasajuric" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sasajuric/120/991_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sasajuric
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Author of Elixir In Action</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="Crowdhailer" data-post="16" data-topic="603">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/crowdhailer/48/2438_2.png" class="avatar"> Crowdhailer:</div>
<blockquote>
<p>Do all OTP processes have a reference to their parent?</p>
</blockquote>
</aside>
<p>There is an undocumented <code>:$ancestors</code> procdict key:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">iex&gt;  Process.get(:"$ancestors")
[#PID&lt;0.50.0&gt;]
</code></pre>
<p>Whether you want to rely on that is another matter <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"> If you want to be more explicit, you can pass the pid of the parent to the child from supervisor’s <code>init/1</code>.</p>
<aside class="quote no-group" data-username="Crowdhailer" data-post="16" data-topic="603">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/crowdhailer/48/2438_2.png" class="avatar"> Crowdhailer:</div>
<blockquote>
<p>Although It still seams messy to have a process know about the structure of a supervision tree it is in.</p>
</blockquote>
</aside>
<p>I agree it’s messy, but I also think it’s fine in those rare cases where siblings are tightly coupled. For other cases, I’d use <code>Registry</code> to discover processes in the system. I talked about this last year at ElixirConf EU. You can find the video <a href="https://www.youtube.com/watch?v=y_b6RTes83c" rel="noopener nofollow ugc">here</a>. There was no <code>Registry</code> back then, so I used <code>gproc</code> as the registry, but other than that, I believe the talk is still up to date.</p>
<aside class="quote no-group" data-username="Crowdhailer" data-post="16" data-topic="603">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/crowdhailer/48/2438_2.png" class="avatar"> Crowdhailer:</div>
<blockquote>
<p>In essence I am having to change the structure of a child after adding it to a supervision tree</p>
</blockquote>
</aside>
<p>Not sure I understand what you mean by this.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="38367" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/when-to-use-otp-vs-bare-processes/603/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-38367" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="38367"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #16"></div>
  </section>
</div>
    <div class="postbit" id="38390" data-post-id="38390">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="dom" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dom/120/9313_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  dom
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Regarding:</p>
<blockquote>
<p>I’m not sure registry offers any value, I would still have to come up with a random key in the registry to avoid clashes required to start the top level supervisor more than once</p>
</blockquote>
<p><code>make_ref()</code> returns a nice unique key.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="38390" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/when-to-use-otp-vs-bare-processes/603/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-38390" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="38390"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #17"></div>
  </section>
</div>
    <div class="postbit" id="38533" data-post-id="38533">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Azolo" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Azolo/120/2189_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Azolo
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="Crowdhailer" data-post="16" data-topic="603">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/crowdhailer/48/2438_2.png" class="avatar"> Crowdhailer:</div>
<blockquote>
<p>Do all OTP processes have a reference to their parent? if so then that is something I have missed and sounds a helpful solution. Although It still seams messy to have a process know about the structure of a supervision tree it is in. In essence I am having to change the structure of a child after adding it to a supervision tree</p>
</blockquote>
</aside>
<p>Yes. It’s matched against in the <code>receive</code> loop. When a OTP special process parent exits then the process must exit.</p>
<aside class="quote no-group" data-username="sasajuric" data-post="17" data-topic="603">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sasajuric/48/991_2.png" class="avatar"> sasajuric:</div>
<blockquote>
<p>There is an undocumented :$ancestors procdict key</p>
</blockquote>
</aside>
<p>This is a little different than a <code>parent</code> in a way I don’t fully understand and the little I can understand, I can’t explain. But I’ll try anyway!</p>
<p>In <code>iex</code> when I use <code>import_file</code> to import an <code>.exs</code> file and in that file I start a linked process there’s an extra <code>pid</code> in <code>$ancestors</code> but I’m still linked to the <code>iex</code> process.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="38533" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/when-to-use-otp-vs-bare-processes/603/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-38533" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="38533"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #18"></div>
  </section>
</div>
    <div class="postbit" id="38534" data-post-id="38534">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Azolo" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Azolo/120/2189_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Azolo
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="kexoth" data-post="13" data-topic="603">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kexoth/48/2982_2.png" class="avatar"> kexoth:</div>
<blockquote>
<p>EDIT: Unfortunately the library is quite outdated, so I ended up using Task. <img src="https://forum.elixirforum.com/images/emoji/apple/confused.png?v=15" title=":confused:" class="emoji" alt=":confused:" loading="lazy" width="20" height="20"></p>
</blockquote>
</aside>
<p>Task actually only meets <a href="http://erlang.org/doc/design_principles/spec_proc.html#id79905" rel="nofollow">one of the requirements for a special process</a>.</p>
<blockquote>
<p>Be started in a way that makes the process fit into a supervision tree</p>
</blockquote> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="38534" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/when-to-use-otp-vs-bare-processes/603/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-38534" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="38534"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #19"></div>
  </section>
</div>
    <div class="postbit" id="38544" data-post-id="38544">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="peerreynders" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/peerreynders/120/5826_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  peerreynders
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="sasajuric" data-post="17" data-topic="603">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sasajuric/48/991_2.png" class="avatar"> sasajuric:</div>
<blockquote>
<p>I’d use Registry to discover processes in the system.</p>
</blockquote>
</aside>
<p>I like the Registry’s <em>option</em> of process <em>access</em> using <a href="https://hexdocs.pm/elixir/master/Registry.html#module-using-in-via" rel="noopener nofollow ugc"><code>:via</code></a> (provided the messaging isn’t too chatty) and having separate registries for each subsystem.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="38544" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/when-to-use-otp-vs-bare-processes/603/21">Post #20</a>
	                </div>
	            </div>
              <div id="likers-container-38544" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="38544"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #20"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/603/load_more?page=3">Load more posts (3 remaining)</a>
</div></template></turbo-stream>