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


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Try using GenServer for this.<br>
My suggestion is as follows:</p>
<pre><code>defmodule MyCustomizedClient do
    use GenServer
    use HTTPoison.Base

    def start_link(opts) do
      GenServer.start_link(__MODULE__, :ok, opts)
    end

    def fetch(my_custom_client_instance, endpoint) do
      GenServer.cast(my_custom_client_instance, {:fetch, endpoint}) # cast is asynchronous
    end

    def handle_cast({:fetch, endpoint}, _state) do # I don't see the need of a state, but feel free
      {:noreply, get(@url &lt;&gt; endpoint)}
    end

    def process_response_body(body) do
      # treat response body as you will
    end
    # maybe other GenServer or HTTPoison callbacks you find necessary
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="112581" 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/how-to-make-async-requests-using-httpoison/19349/22">Post #21</a>
	                </div>
	            </div>
              <div id="likers-container-112581" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="112581"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #21"></div>
  </section>
</div>
    <div class="postbit" id="112585" data-post-id="112585">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Not for the problem described here but a complementary tactic for <em>How to <strong>not block</strong> but still <strong>appear</strong> synchronous to every caller</em>:  <a href="https://erlangcentral.org/wiki/Building_Non_Blocking_Erlang_apps" rel="noopener nofollow ugc">Building Non Blocking Erlang apps</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="112585" 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/how-to-make-async-requests-using-httpoison/19349/23">Post #22</a>
	                </div>
	            </div>
              <div id="likers-container-112585" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="112585"
                     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>