<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="38547" data-post-id="38547">
  <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="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>That seems like trying to solve the wrong problem…</p>
<p>If you don’t want named process then just start a supervised <code>GenServer</code> and start a linked <code>Supervisor</code> from it? Am I missing something important here?</p>
<p>Edit: I think the only thing you would need to make sure of is a shutdown strategy. You would need the <code>GenServer</code> to exit after the child supervisor does.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="38547" 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/22">Post #21</a>
	                </div>
	            </div>
              <div id="likers-container-38547" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="38547"
                     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 #21"></div>
  </section>
</div>
    <div class="postbit" id="38548" data-post-id="38548">
  <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="Azolo" data-post="19" 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/azolo/48/2189_2.png" class="avatar"> Azolo:</div>
<blockquote>
<p>This is a little different than a parent in a way I don’t fully understand and the little I can understand, I can’t explain. But I’ll try anyway!</p>
</blockquote>
</aside>
<p>Ancestors are recursive parents, with the head being a direct parent. The parent is the process which invoked a <code>proc_lib</code> function to start the process. All variants of <code>proc_lib</code> starter functions (such as <code>start_link</code>, <code>spawn_link</code>) will run the process inside <code>proc_lib:init_p</code>, which sets the ancestors procdict flag. See <a href="https://github.com/erlang/otp/blob/master/lib/stdlib/src/proc_lib.erl#L228" rel="noopener nofollow ugc">here</a> and <a href="https://github.com/erlang/otp/blob/master/lib/stdlib/src/proc_lib.erl#L241" rel="noopener nofollow ugc">here</a>.</p>
<aside class="quote no-group" data-username="Azolo" data-post="19" 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/azolo/48/2189_2.png" class="avatar"> Azolo:</div>
<blockquote>
<p>In iex when I use import_file to import an .exs file and in that file I start a linked process there’s an extra pid in $ancestors but I’m still linked to the iex process.</p>
</blockquote>
</aside>
<p>Not sure what you mean by “extra pid”. If you import a script, the script is evaluated, which (I presume without trying it out) happens inside the shell process. Therefore, if from a script you <code>start_link</code> a process (let’s call it <code>foo</code>), per what I said above, its parent will be the shell process. If <code>foo</code> starts its own child (let’s call it <code>bar</code>), then ancestors of <code>bar</code> are <code>foo</code> and the shell 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="38548" 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/23">Post #22</a>
	                </div>
	            </div>
              <div id="likers-container-38548" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="38548"
                     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 #22"></div>
  </section>
</div>
    <div class="postbit" id="38553" data-post-id="38553">
  <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">
								<p>Indeed, you are right. I wonder why I got so confused about.</p>
<p>Maybe it was just because none of the <code>gen</code> processes look up the <code>pdict</code>, they keep track of their parents in their loops.</p>
<p>Maybe I just thought there was some grander purpose and the <code>pdict</code> lookup wasn’t always reliable.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="38553" 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/24">Post #23</a>
	                </div>
	            </div>
              <div id="likers-container-38553" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="38553"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>