<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="98347" data-post-id="98347">
  <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">
								<p>I think the nicest way to probably do this, is to notify the user once it’s done using a WebSocket connection.<br>
Starting the job then in a background task using the functions in the <code>Task</code> module; I think what <a class="mention" href="/u/rjk" rel="nofollow">@rjk</a> proposes sounds the most sensible, with as final command, sending stuff to the websocket channel (as well as possibly persisting a ‘success’ result, such that when the user would have closed the browser tab in the meantime and comes back to the application, that they are able to see that something had happened in the meantime).</p>
<p>I actually think that many of the background-task libraries that currently exist on hexpm were written by people who:</p>
<ul>
<li>either attempted to re-create something they knew from another programming context while they were still new to Elixir.</li>
<li>or wanting to interface with an external system (like RabbitMQ, Redis or Celery) that is part of their pre-existing (Ruby/Python/NodeJS etc) application.</li>
</ul> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="98347" 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/how-to-handle-background-jobs-with-elixir-phoenix/16797/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-98347" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="98347"
                     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>