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


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="BitGonzo" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/BitGonzo/120/8083_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  BitGonzo
                    <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>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Thanks for the write-up.</p>
<aside class="quote no-group" data-username="peerreynders" data-post="11" data-topic="12635">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/peerreynders/48/5826_2.png" class="avatar"> peerreynders:</div>
<blockquote>
<p>where he found out that for him personally it was necessary to do lots of little exercises before his mindset shifted sufficiently before it made sense to attempt a larger project.</p>
</blockquote>
</aside>
<p>This is a great approach, but I largely learn by taking on more than I can chew, by drowning myself in complexity and overwhelming myself with lots of new concepts and languages and frameworks. This gets me to the most problematic questions very quickly, which I then search on, and, if not fruitful, bring to the community (hence being here). I can suss out most of the small things on my own. This brute-force approach has served me well for the last 8 years, but is of course not without its downsides, and, I will say, I have definitely jumped the gun by asking questions here without having even gone through the getting started guide. No excuse for that.</p>
<p>But.. though I am taking on Elixir, Phoenix, OTP, Docker, Kubernetes and quite a substantial project, I still have enough experience to lean back on which has significantly reduced the learning curve – and, sadly, as is understandable, had me drag that past experience into new areas, perhaps where it doesn’t belong. No doubt I’ll have to rethink how I program, even if not just for the reason that I’m taking on my first functional programming language.</p>
<p>Either way, Verk, or some kind of worker process is critical to the underlying feature-set of my application(s), and usually one of the first problems I have to solve when embarking on any new non-trivial web application. I’m very happy with the current state of my extremely modest but expanding codebase. It is vastly simpler than counterparts I’ve built in other languages/frameworks, and it is implicit in all the right ways.</p>
<p>I’m now diving into the supervision tree, OTP and the rest to better understand the underlying architecture – this is crucial, anyway, for me to configure BEAM to work across Kube nodes with auto-discovery.. but the fact is I don’t get excited until I can see myself building something wide-ranging and useful. I was only temporarily happy with using <code>--no-halt</code> and being done with it just because it removes my current roadblock. I’d definitely be returning to the issue to ensure I’m not doing anything stupid.</p>
<aside class="quote no-group" data-username="peerreynders" data-post="11" data-topic="12635">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/peerreynders/48/5826_2.png" class="avatar"> peerreynders:</div>
<blockquote>
<p>So it seems to me that Verk’s primary intent is to be run in the same primary application that is already running Ecto and the various bits that Phoenix relies on like Cowboy.</p>
</blockquote>
</aside>
<p>Verk is framework agnostic, and there isn’t a mention of Phoenix in the docs or code or even in the issues (apart from a ticket I created). I’m currently switching the supervisors that start with the application based on an env var (“APP_WORKER”). If present, it will load <code>Verk.Supervisor</code>, and any other dependent supervisors (<code>Ecto.Repo</code>), and if not present it loads my default Phoenix supervisors, along with <code>Redix</code> to enqueue jobs from my app.</p>
<p>I’m not entirely happy with that. There was a suggestion in another thread to separate out the domain/data layer and share that code between two completely separate applications – and I have heard I can add a whole other application as a dependency. This is stuff I’ll be researching a little more. My current setup isn’t ideal, but it is a pattern that works for many production systems, and, though a little tangled, is simple to maintain. However, I would like to separate the worker dependencies, because my worker doesn’t need Phoenix and a few other dependencies that my Phoenix app relies on. If it becomes a serious problem when I start to deploy (within the next week), then I’ll rethink the whole structure of it.</p>
<aside class="quote no-group" data-username="peerreynders" data-post="11" data-topic="12635">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/peerreynders/48/5826_2.png" class="avatar"> peerreynders:</div>
<blockquote>
<p>Now this describes a somewhat different situation. Usually a “box” is running a node and it’s the node that is running your primary application. So each “box” runs it’s own node with applications running in it. Your description sounds like you intend to run Verk on a node that is separate from Phoenix (possibly even Ecto as part of yet another application on yet another node). This can be accomplished with distributed Elixir but interestingly:</p>
</blockquote>
</aside>
<p>Exactly.. I should be careful about my wording! That’s right, I’ll have Verk in a pod that will be deployed to any number of nodes, and I’ll have my Phoenix app in another pod. They will only speak to each other through Redis, my app will push data to redis and Verk will pull, which will then use my models in my app to run business logic and query the database.</p>
<p>But I can see how a distributed pure Elixir setup might accomplish this. Likely, in the future, I’ll attempt to deploy a pure distributed Elixir version of my architecture and see how it fairs. But I just don’t think it will offer the kind of tooling I have with Kubernetes, and Kube is something I can use to manage clusters of any kind of application, not just Erlang-based. And there is no substitute in pure Elixir for a durable worker system. To me, that’s reason enough to stick with my current setup.</p>
<aside class="quote no-group" data-username="peerreynders" data-post="11" data-topic="12635">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/peerreynders/48/5826_2.png" class="avatar"> peerreynders:</div>
<blockquote>
<p>Sorry if I came across as discouraging the use of --no-halt. To me it just seemed more advantageous to seize the opportunity to shed a bit more light of what an “application” actually is in the Elixir world rather than sweeping it under the carpet with --no-halt.</p>
</blockquote>
</aside>
<p>Absolutely, and I really appreciate the breakdown. There are quite a few new concepts I need to get my head around, but I’m having a lot of fun - currently with simple pattern matching and piping. Just trying to shed old OOP habits, and am already starting to see the advantages.</p>
<p>One of the reasons I said learning both Elixir and Phoenix at the same time might have been a classic mistake (same mistake I made with Ruby/Rails), is because I didn’t realise <code>application</code> was an elixir concept. Again, better run through those getting started guides!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="70930" 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/basic-missing-a-fundamental-concept-with-applications-appreciate-help-mix-run-not-waiting/12635/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-70930" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="70930"
                     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="70993" data-post-id="70993">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="BitGonzo" data-post="12" data-topic="12635">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/bitgonzo/48/8083_2.png" class="avatar"> BitGonzo:</div>
<blockquote>
<p>I didn’t realise application was an elixir concept</p>
</blockquote>
</aside>
<p>More accurately <code>application</code> is an OTP concept that is exposed through Elixir’s <code>Application</code> module.  You might look at:</p>
<p>the first few paragraphs of <a href="http://learnyousomeerlang.com/building-otp-applications#why-would-i-want-that" class="inline-onebox" rel="noopener nofollow ugc">Building OTP Applications | Learn You Some Erlang for Great Good!</a></p>
<aside class="onebox allowlistedgeneric" data-onebox-src="https://www.erlang.org/doc/system/applications.html">
  <header class="source">

      <a href="https://www.erlang.org/doc/system/applications.html" target="_blank" rel="noopener nofollow">erlang.org</a>
  </header>

  <article class="onebox-body">
    

<h3><a href="https://www.erlang.org/doc/system/applications.html" target="_blank" rel="noopener nofollow">Applications — Erlang System Documentation v29.0.2</a></h3>



  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>

<aside class="onebox allowlistedgeneric" data-onebox-src="https://elixir.hexdocs.pm/Application.html">
  <header class="source">

      <a href="https://elixir.hexdocs.pm/Application.html" target="_blank" rel="noopener nofollow ugc">elixir.hexdocs.pm</a>
  </header>

  <article class="onebox-body">
    

<h3><a href="https://elixir.hexdocs.pm/Application.html" target="_blank" rel="noopener nofollow ugc">Application — Elixir v1.20.2</a></h3>



  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>
 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="70993" 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/basic-missing-a-fundamental-concept-with-applications-appreciate-help-mix-run-not-waiting/12635/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-70993" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="70993"
                     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="70997" data-post-id="70997">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="BitGonzo" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/BitGonzo/120/8083_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  BitGonzo
                    <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>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Cheers. I’ll run through those links!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="70997" 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/basic-missing-a-fundamental-concept-with-applications-appreciate-help-mix-run-not-waiting/12635/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-70997" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="70997"
                     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="70998" data-post-id="70998">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Qqwy" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Qqwy/120/1349_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Qqwy
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>TypeCheck Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="BitGonzo" data-post="12" data-topic="12635">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/bitgonzo/48/8083_2.png" class="avatar"> BitGonzo:</div>
<blockquote>
<p>I didn’t realise application was an elixir concept.</p>
</blockquote>
</aside>
<p>To shed a little bit more light on it:</p>
<p>The terms OTP ‘Application’ and OTP ‘Process’ had me confused for quite some time when I started out working with Elixir, because they feel very different from operating-system-level applications and processes.</p>
<p>But here is the thing: When running Erlang or Elixir code, the Open Telecom Platform/the BEAM Virtual Machine is the environment the stuff runs in. That this might in turn run on top of another operating system (Which is not always the case – see <a href="http://nerves-project.org/" rel="nofollow">Nerves</a> or <a href="http://www.erlangonxen.org/" rel="noopener nofollow ugc">Xen</a> for instance) is not important.</p>
<p>The service your ‘OTP System’ <small>(Which might run as an Operating-System level application)</small> provides might be comprised of one or more OTP applications, which can be started/stopped independently.<br>
OTP processes also work very similar to operating-system-level processes, in the sense that they are scheduled and can pass messages <small>(Although Erlang’s message passing API is a lot cleaner than managing Unix pipes <img src="https://forum.elixirforum.com/images/emoji/apple/stuck_out_tongue.png?v=15" title=":stuck_out_tongue:" class="emoji" alt=":stuck_out_tongue:" loading="lazy" width="20" height="20"> )</small>, but of course they are far more lightweight than OS-processes.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="70998" 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/basic-missing-a-fundamental-concept-with-applications-appreciate-help-mix-run-not-waiting/12635/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-70998" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="70998"
                     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="70999" data-post-id="70999">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="BitGonzo" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/BitGonzo/120/8083_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  BitGonzo
                    <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>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>After reading through some of these links.. it seems like I might be able to have a completely separate application for my worker, and reference my Phoenix application as a dependency? – but I’d want to do that without running the application; using it as a library application.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="70999" 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/basic-missing-a-fundamental-concept-with-applications-appreciate-help-mix-run-not-waiting/12635/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-70999" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="70999"
                     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="71085" data-post-id="71085">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Yeah <a class="mention" href="/u/qqwy" rel="nofollow">@Qqwy</a> is dead on here.  The BEAM VM is more like the hardware of a system.  OTP is like the OS.  Processes are like Processes on a real OS.  Applications are like real applications on an OS (groups of processes).  Etc… etc… etc…  <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> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="71085" data-batch-url="/posts/batch_likers">
                        3
                      </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/basic-missing-a-fundamental-concept-with-applications-appreciate-help-mix-run-not-waiting/12635/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-71085" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="71085"
                     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>