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


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="washeku" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  washeku
                    <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>And how can I start a GenServer dynamically triggered by, for example, a user of my webapplication clicking on a button on a page? a single GenServer for a single user. 5 users – 5 GenServers. and so on.</p>
<p>will “MyGenServer.start_link” start a new instance every time I call it?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="24878" 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/background-task-with-autokilling-itself-and-repeated-action-each-n-minutes/3773/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-24878" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="24878"
                     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="24884" data-post-id="24884">
  <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">
								<aside class="quote no-group" data-username="washeku" data-post="12" data-topic="3773">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/w/5e9695/48.png" class="avatar"> washeku:</div>
<blockquote>
<p>And how can I start a GenServer dynamically triggered by, for example, a user of my webapplication clicking on a button on a page?</p>
</blockquote>
</aside>
<p>I’d put them in a <a href="http://elixir-lang.org/getting-started/mix-otp/supervisor-and-application.html#simple-one-for-one-supervisors" rel="nofollow">simple one-for-one supervisor</a>, as which point just call a function on the supervisor to start it, and in that function you just spawn the task using the same code as at that above link.  <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 no-group" data-username="washeku" data-post="12" data-topic="3773">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/w/5e9695/48.png" class="avatar"> washeku:</div>
<blockquote>
<p>a single GenServer for a single user. 5 users – 5 GenServers. and so on.</p>
<p>will “MyGenServer.start_link” start a new instance every time I call it?</p>
</blockquote>
</aside>
<p>Yes, but if you call start_link the tasks will be killed if the channel dies, which might actually be what you want, if so then don’t use the supervisor I mentioned above.</p>
<p>If you want to aggregate them together, so only one is setup for a given task via some ID of your choosing then a simple one-for-one supervisor is good, then many channels can share the same information (Phoenix.PubSub would be useful to send the information back for example).  <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="24884" 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/background-task-with-autokilling-itself-and-repeated-action-each-n-minutes/3773/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-24884" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="24884"
                     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="24910" data-post-id="24910">
  <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>If you go with GenServer and :send_after callback, it is actually important that the background job does <em>not</em> run in a process of GenServer.</p>
<p>Because if you do the actual work inside GenServer, it won’t stop to receive the custom message you are sending with Process.send_after.</p>
<p>I think I’d go with a GenServer who’d be a “process killer”, and separate processes for each background job. In such case a newly created process would register itself to be killed by sending a message to GenServer. “Process killer” would send itself a message after X seconds, reminding itself to kill given process if it’s still running.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="24910" 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/background-task-with-autokilling-itself-and-repeated-action-each-n-minutes/3773/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-24910" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="24910"
                     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="24917" data-post-id="24917">
  <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>+1</p>
<p>Two processes would be my choice here as well. One does the job, another watches over the job runner and terminates it if it doesn’t finish in the given timeframe. That should properly take care of the case where the job is blocking for a long time (possibly forever).</p>
<p>Arguably the simplest solution could be based on a task:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">poll_loop = Task.async(fn -&gt;
  # simulation of a poll loop
  :timer.sleep(:rand.uniform(:timer.seconds(2)))
end)

# waiting for at most 1 second for the loop to finish
case Task.yield(poll_loop, :timer.seconds(1)) do
  {:ok, _} -&gt; IO.puts "loop finished."
  nil -&gt;
    IO.puts "timeout: killing the loop runner."
    Task.shutdown(poll_loop, :brutal_kill)
end
</code></pre>
<p>Probably the simplest way to implement the poll loop would be through recursion:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">def poll_loop() do
  case poll() do
    :ok -&gt; :ok
    :error -&gt;
      :timer.sleep(:timer.seconds(1))
      poll_loop()
  end
end
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="24917" 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/background-task-with-autokilling-itself-and-repeated-action-each-n-minutes/3773/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-24917" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="24917"
                     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="24918" data-post-id="24918">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I’ve done similar things in Erlang, and the same should be completely possible with Elixir… so, as <a class="mention" href="/u/hubertlepicki" rel="nofollow">@hubertlepicki</a> notes you have your GenServer (or just any process, doesn’t have to be a GenServer .. ) and then you have a function there, like:</p>
<pre><code>defmodule Mod do
    def timed_job(job_data) do
        reciever = self()
        pid = spawn_link(fn -&gt; send reciever, { :ok, job_data } end)
        receive do
            { :ok, response } -&gt; 
                IO.puts("Got a response!")
                response
        after 1_000 -&gt;
            IO.puts("Killing due to timeout.. sigh")
            Process.exit(pid, :kill)
            { :error, "Job timed out" }
        end
    end
end

Mod.timed_job(1)
</code></pre>
<p>This way you give your process a certain amount of time to do its work an return a message, otherwise it is killed (in the after clause) and an error is returned. You can see this in action with the above by changing the anonymous function to sleep for longer than the after clause timeout value before sending the message.</p>
<p>For added fun, you can make this clusterable by adding a node argument to the timed_job function’s params and using Node.spawn_link instead of just the vanilla spawn_link.. then you can run your jobs on whatever node in your BEAM cluster you want.</p>
<p>I have used this in other projects to rather enjoyable effect <img src="https://forum.elixirforum.com/images/emoji/apple/wink.png?v=15" title=":wink:" class="emoji" alt=":wink:" loading="lazy" width="20" height="20"></p>
<p>hth…</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="24918" 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/background-task-with-autokilling-itself-and-repeated-action-each-n-minutes/3773/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-24918" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="24918"
                     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="24919" data-post-id="24919">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>ah.. and I suppose one can  imagine various ways to get fancy with this: caller defined timeouts (so the caller, not the job itself, decides how long it has to run), multiple return values accepted by receive such as a :time_extension message which would allow the receiver to decide whether or not to give it more time or to kill it right there …</p>
<p>there is a small gotcha in my code above if that is run inside a process that is getting other messages: any message shaped like { :ok, response} will trigger that receive .. in which case you want something less generic sent from the worker function such as { :background_job, jobid, result } or whatever. this will prevent other messages in your inbox from getting processed in place of the background job. Of course, if the Mod.timed_job code is run in its own dedicated process (and why not! <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"> then this is not an issue.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="24919" 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/background-task-with-autokilling-itself-and-repeated-action-each-n-minutes/3773/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-24919" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="24919"
                     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="24941" data-post-id="24941">
  <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">
								<aside class="quote no-group" data-username="sasajuric" data-post="15" data-topic="3773">
<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>Two processes would be my choice here as well. One does the job, another watches over the job runner and terminates it if it doesn’t finish in the given timeframe. That should properly take care of the case where the job is blocking for a long time (possibly forever).</p>
</blockquote>
</aside>
<p>If it is a blocking job then yes definitely, two processes, but if it is not blocking (really it should not be if made properly) then one is good.</p>
<p>Although having a dedicated killer process can be reusable elsewhere.  ^.^</p>
<p>Remember to mark expected messages back with a <code>ref</code> or so.  ^.^</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="24941" 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/background-task-with-autokilling-itself-and-repeated-action-each-n-minutes/3773/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-24941" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="24941"
                     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="24995" data-post-id="24995">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote group-livebook_core_team" data-username="josevalim" data-post="3" data-topic="3773">
<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>For some yes, for others no. <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"> We need to be careful with those sentences because they may discourage conversation. If something is trivial and someone doesn’t understand it, they may think it is their fault after all.</p>
</blockquote>
</aside>
<p>Kudos. That’s one of the reasons why Elixir’s community is constantly growing.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="24995" 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/background-task-with-autokilling-itself-and-repeated-action-each-n-minutes/3773/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-24995" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="24995"
                     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="24997" data-post-id="24997">
  <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">
								<blockquote>
<p>but if it is not blocking (really it should not be if made properly) then one is good</p>
</blockquote>
<p>The reason for pushing lots of stuff to background jobs is exactly because they are not asynchronous. Take sending e-mail using SMTP as a classic example, processing images etc. Some things can’t be easily written in async manner, and - more importantly - you may not want to write them this way. Asymc code is - as a rule - more difficult to write and understand than sequential. This is exactly the reason why I’d choose Elixir over Node code any time.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="24997" 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/background-task-with-autokilling-itself-and-repeated-action-each-n-minutes/3773/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-24997" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="24997"
                     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="25025" data-post-id="25025">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Interestingly (or .. maybe not? <img src="https://forum.elixirforum.com/images/emoji/apple/wink.png?v=15" title=":wink:" class="emoji" alt=":wink:" loading="lazy" width="20" height="20"> I’ve used the same technique in my comment above with one and two processes, depending on what I was trying to achieve…</p>
<p>Two processes to make sync work async (as you noted), but the same pattern but called directly to turn an async job into a sync one. I noted in one of my comments that one can use Node.spawn_link to run jobs across a cluster … I had one project where some of the code was already async but needed to make a (possibly) remote call somewhere on the cluster. It made the most sense to block on a remote call before continuing, and the “call the function, drop into a receive with a timeout” approach turned the remote call into a local syncronous function.</p>
<p>It’s a neat symmetry imho that the same function can be used to modify both sync-&gt;async and async-&gt;sync all depending on what process it is called from! <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="25025" 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/background-task-with-autokilling-itself-and-repeated-action-each-n-minutes/3773/21">Post #20</a>
	                </div>
	            </div>
              <div id="likers-container-25025" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="25025"
                     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/3773/load_more?page=3">Load more posts (1 remaining)</a>
</div></template></turbo-stream>