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


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="OvermindDL1" data-post="83" data-topic="14302">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/overminddl1/48/2677_2.png" class="avatar"> OvermindDL1:</div>
<blockquote>
<p>I would say yes, or rather have a runtime configuration delegate to the build-time configuration if not otherwise specified (thus giving a nice fallback order).</p>
</blockquote>
</aside>
<p>Yes, this is what I was talking about with <code>sys.config</code>.</p>
<aside class="quote no-group" data-username="OvermindDL1" data-post="83" data-topic="14302">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/overminddl1/48/2677_2.png" class="avatar"> OvermindDL1:</div>
<blockquote>
<p>I actually edit this file fairly often to change boot-up configs… &gt;.&gt;</p>
</blockquote>
</aside>
<p>I meant it to be “readonly” just for users who are not familiar with releases as this might be a foreign concept for them and treated as transpiled build time mix config, fallback from runtime config as you mentioned. But of course if you know what you are doing, it is are editable and perfectly fine. If they want to do runtime config (and probably should) they need explicitly design it, ideally with the support of stdlib.</p>
<p>The only thing to state clear to Elixir developers is when building a release, mix config is compile time and any dynamic code will be evaluated at compile time. I don’t see it as an issue to be honest. A similar problem exists with module attributes, they are compile time and as far as I know we don’t try to fix them but rather educate people:</p>
<p>“Every time an attribute is read inside a function, a snapshot of its current value is taken. In other words, the value is read at compilation time and not at runtime. As we are going to see, this also makes attributes useful to be used as storage during module compilation.”<br>
Source: <a href="https://elixir-lang.org/getting-started/module-attributes.html" rel="nofollow">https://elixir-lang.org/getting-started/module-attributes.html</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="82778" data-batch-url="/posts/batch_likers">
                        2
                      </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/proposal-moving-towards-discoverable-config-files/14302/84">Post #83</a>
	                </div>
	            </div>
              <div id="likers-container-82778" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="82778"
                     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 #83"></div>
  </section>
</div>
    <div class="postbit" id="82780" data-post-id="82780">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I deploy releases to immutable servers populated by Ansible scripts that use a templated version of <code>sys.config</code> for the deployed release, so I mostly care about ensuring that the boot-time interpretation of <code>sys.config</code> remains sane (and I never use environment variable interpolation there). Beyond that, I want to figure out how to enable Consul, Vault, and similar technologies for runtime reconfiguration of, say, Ecto. (If we decide to cycle the database credentials for one of our Repos, how do we reconfigure and restart?)</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="82780" 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/proposal-moving-towards-discoverable-config-files/14302/85">Post #84</a>
	                </div>
	            </div>
              <div id="likers-container-82780" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="82780"
                     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 #84"></div>
  </section>
</div>
    <div class="postbit" id="82782" data-post-id="82782">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="josevalim" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/120/1787_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  josevalim
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Elixir</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="dimitarvp" data-post="80" data-topic="14302">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/48/38664_2.png" class="avatar"> dimitarvp:</div>
<blockquote>
<p>I have a politics related question: how willing is Elixir’s core team to introduce a breaking change that forces everybody to migrate to a seemingly perfect solution (which is yet to be discovered)?</p>
</blockquote>
</aside>
<p>There is no chance of a breaking change. We can introduce a whole new way, but we would need a backwards compatible migration path. Breaking changes only on v2.0 (which is not coming any time soon).</p>
<aside class="quote no-group" data-username="GregMefford" data-post="82" data-topic="14302">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/gregmefford/48/4875_2.png" class="avatar"> GregMefford:</div>
<blockquote>
<p>If <a href="https://forum.elixirforum.com/clicks/track?url=https%3A%2F%2Fhexdocs.pm%2Felixir%2Fmaster%2Flibrary-guidelines.html&amp;post_id=82625&amp;topic_id=14302" rel="nofollow">the guidelines for library authors </a> say we should not use application configuration unless strictly necessary, then we should make it less-convenient for them to do that, so that we have less problems with configuration being in multiple places. It feels like the proposal being discussed in this thread makes it easier for both library users and library authors to continue to <em>not</em> follow that advice.</p>
</blockquote>
</aside>
<p>I know this is a long discussion but we have debated those exact points before: I don’t think we should punish how users configure libraries because some libraries are forcing users to use the application environment. There are legitimate cases of both runtime and compile-time application configuration and those should not be made harder to deal with because of a third party misuse.</p>
<p>However, this proposal does not concern library authors at all and they won’t see any changes for now. But something needs to be done though in how the application environment is used by libraries, for the reasons you said.</p>
<aside class="quote no-group" data-username="OvermindDL1" data-post="83" data-topic="14302">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/overminddl1/48/2677_2.png" class="avatar"> OvermindDL1:</div>
<blockquote>
<p>Yes, definitely this, the interface needs to be different to get each stage’s configurations.</p>
</blockquote>
</aside>
<p>Yep, that will probably what will end-up happening, although it is a separate discussion.</p>
<aside class="quote no-group" data-username="OvermindDL1" data-post="83" data-topic="14302">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/overminddl1/48/2677_2.png" class="avatar"> OvermindDL1:</div>
<blockquote>
<p>Exactly! Operator configurations belong in the system environment, not internal to a baked release application or so (thus system environment, external json, JVM’ish XML, whatever…).</p>
</blockquote>
</aside>
<p>I think I am missing the context here. How and where would the wiring of the system environment/external json/etc with the system happen?</p>
<aside class="quote no-group" data-username="OvermindDL1" data-post="83" data-topic="14302">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/overminddl1/48/2677_2.png" class="avatar"> OvermindDL1:</div>
<blockquote>
<p>Same here, and the fact that almost no library responds to change made here is maddening, I have to kill entire process trees to get them to update</p>
</blockquote>
</aside>
<p>Well, this is a separate issue and one that also exists in Erlang (it is a orthogonal discussion) which is that some configuration is read when the application is starting and changing this configuration won’t have any effect on the system unless the application or part of the supervision tree is restarted.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="82782" 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/proposal-moving-towards-discoverable-config-files/14302/86">Post #85</a>
	                </div>
	            </div>
              <div id="likers-container-82782" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="82782"
                     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 #85"></div>
  </section>
</div>
    <div class="postbit" id="82845" data-post-id="82845">
  <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">
								<p>One thing I think I’d really find useful, and perhaps it could be added as a part of implementing <code>on_boot</code> is the support for a custom boot callback. So something like:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir"># in mix.exs

def project do
  [
    # ...,

    boot: {MyMod, some_arg}
  ]
end
</code></pre>
<p>Which would cause e.g. <code>MyMod.boot(some_arg)</code> to be invoked after Elixir app has been started, but before any other app. This would allow me to e.g. set app env for logger at runtime from e.g. OS env.</p>
<p>Note that I’m not suggesting this as a replacement for <code>on_boot</code>, but more like a lower level interface for those of us who like to have more control, and prefer explicit code over out-of-band scripts.</p>
<p>Going further, I think it would be interesting if there was a <code>before_boot</code> callback, invoked before each app is being started.</p>
<p>Finally, it would be great if we could somehow affect the app starting order, so e.g. I could specify that etcd client should be started before the logger (which can obviously work only if etcd client isn’t depending on logger).</p>
<p>The last two features would allow me to configure logger via etcd, or generally speaking any app by using functions from another app.</p>
<p>Thoughts?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="82845" data-batch-url="/posts/batch_likers">
                        7
                      </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/proposal-moving-towards-discoverable-config-files/14302/87">Post #86</a>
	                </div>
	            </div>
              <div id="likers-container-82845" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="82845"
                     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 #86"></div>
  </section>
</div>
    <div class="postbit" id="82853" data-post-id="82853">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="hubertlepicki" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hubertlepicki/120/6822_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  hubertlepicki
                  </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="87" data-topic="14302">
<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>Which would cause e.g. <code>MyMod.boot(some_arg)</code> to be invoked after Elixir app has been started, but before any other app. This would allow me to e.g. set app env for logger at runtime from e.g. OS env.</p>
</blockquote>
</aside>
<p>I assumed you could just call that module and function from <code>on_boot</code> like:</p>
<pre><code>on_boot do
  config :some, :config
  ...
  MyMod.some_call(some_args)
end
</code></pre>
<p>But I agree that I already planed to abuse it this way in my head, so if the above would be considered abuse a separate callback would do as well. Either one would work for me.</p>
<p>Currently we’re doing a distillery hooks, that are obviously only executed when in release, and this results in some doubled logic.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="82853" data-batch-url="/posts/batch_likers">
                        2
                      </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/proposal-moving-towards-discoverable-config-files/14302/88">Post #87</a>
	                </div>
	            </div>
              <div id="likers-container-82853" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="82853"
                     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 #87"></div>
  </section>
</div>
    <div class="postbit" id="82854" data-post-id="82854">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="josevalim" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/120/1787_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  josevalim
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Elixir</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I like this idea a lot although having to insert order between dependencies is a big concern. The other concern is that, if somebody calls <code>Application.start/2</code> elsewhere during <code>before_boot</code>, it will bypass the <code>before_boot</code> for the started app too.</p>
<p>I wonder if we can slightly flip it around and make the <code>before_boot</code> callback per application? So you would have a boot module and in there you can do:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">def before_boot(:logger) do
  {:ok, logger_config}
end
</code></pre>
<p>This <em>may</em> help us know exactly what are configuring and therefore help us detect the cases where <code>before_boot</code> has been rendered useless but I need to put more thought into this.</p>
<p>The only issue I can think for now of breaking the <code>before_boot</code> callback per application is that you don’t want to access etcd per invocation of the <code>before_boot</code> callback, so you would need  to access etcd once and store it somewhere, such as an agent, but that would have to be outside of a supervision tree, since the apps have not started yet, and that makes me worried.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="82854" data-batch-url="/posts/batch_likers">
                        7
                      </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/proposal-moving-towards-discoverable-config-files/14302/89">Post #88</a>
	                </div>
	            </div>
              <div id="likers-container-82854" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="82854"
                     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 #88"></div>
  </section>
</div>
    <div class="postbit" id="82855" data-post-id="82855">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="josevalim" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/120/1787_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  josevalim
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Elixir</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><a class="mention" href="/u/sasajuric" rel="nofollow">@sasajuric</a> Ignore what I said, <a class="mention" href="/u/hubertlepicki" rel="nofollow">@hubertlepicki</a> is correct.</p>
<p>In terms of expressive power, the <code>boot</code> module is the same as <code>on_boot</code>. I could do this with <code>on_boot</code>:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">on_boot  do 
  Application.start(:etcd)
  for {app, config} &lt;- ETCD.config(:my_app) do
    config app, config
  end
  :ok
end
</code></pre>
<p>Of course having it in a module gives more structure than a script in config, but I wanted to point out that they allow/disallow the same patterns.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="82855" data-batch-url="/posts/batch_likers">
                        5
                      </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/proposal-moving-towards-discoverable-config-files/14302/90">Post #89</a>
	                </div>
	            </div>
              <div id="likers-container-82855" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="82855"
                     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 #89"></div>
  </section>
</div>
    <div class="postbit" id="82856" data-post-id="82856">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>This would be awesome, especially for creating scripts that start clustered deployments that are usually messed up and require handling connections, staritng apps in correct order etc. etc.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="82856" 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/proposal-moving-towards-discoverable-config-files/14302/91">Post #90</a>
	                </div>
	            </div>
              <div id="likers-container-82856" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="82856"
                     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 #90"></div>
  </section>
</div>
    <div class="postbit" id="82858" data-post-id="82858">
  <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="hubertlepicki" data-post="88" data-topic="14302">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hubertlepicki/48/6822_2.png" class="avatar"> hubertlepicki:</div>
<blockquote>
<p>I assumed you could just call that module and function from <code>on_boot</code> like:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">on_boot do
  config :some, :config
  ...
  MyMod.some_call(some_args)
end
</code></pre>
</blockquote>
</aside>
<p>Good point and a nice trick, I love it <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"></p>
<aside class="quote group-livebook_core_team" data-username="josevalim" data-post="90" data-topic="14302">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/48/1787_2.png" class="avatar"> josevalim:</div>
<blockquote>
<p>Of course having it in a module gives more structure than a script in config, but I wanted to point out that they allow/disallow the same patterns.</p>
</blockquote>
</aside>
<p>Yes, I didn’t envision for this to support different patterns than <code>on_boot</code>. It would be nice to have a bit of more structure, but I guess what <a class="mention" href="/u/hubertlepicki" rel="nofollow">@hubertlepicki</a> suggests is a solid suggestion which doesn’t require any additional mechanisms, other than <code>on_boot</code>. I could just delegate to the desired module myself, and structure my code there, or I could use your approach and provide the app boot parameters in <code>on_boot</code>. I think I’d be fine with either.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="82858" 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/proposal-moving-towards-discoverable-config-files/14302/92">Post #91</a>
	                </div>
	            </div>
              <div id="likers-container-82858" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="82858"
                     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 #91"></div>
  </section>
</div>
    <div class="postbit" id="82870" data-post-id="82870">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Would <code>on_boot</code> have some mechanism to check the return value, or is it just fire-and-forget? For example, would there be a way to signal that the <code>etcd</code> call failed for some reason and should be tried again later? What if something in <code>on_boot</code> raises an exception?</p>
<p>I assume this would cause the BEAM to just shut down, but maybe it could keep going and end up failing later only if your application was designed to crash without valid configuration at boot time. In which case, it makes me wonder what <code>on_boot</code> is buying us, if we still have to put code inside the application for the case where <code>on_boot</code> fails.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="82870" 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/proposal-moving-towards-discoverable-config-files/14302/93">Post #92</a>
	                </div>
	            </div>
              <div id="likers-container-82870" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="82870"
                     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 #92"></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/14302/load_more?page=10">Load more posts (18 remaining)</a>
</div></template></turbo-stream>