<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Buffer on cassiobotaro</title><link>https://cassiobotaro.dev/en/tags/buffer/</link><description>Recent content in Buffer on cassiobotaro</description><generator>Hugo</generator><language>en</language><lastBuildDate>Tue, 27 Oct 2026 15:33:24 -0300</lastBuildDate><atom:link href="https://cassiobotaro.dev/en/tags/buffer/index.xml" rel="self" type="application/rss+xml"/><item><title>Go Concurrency - Semaphore</title><link>https://cassiobotaro.dev/en/posts/go-concurrency-semaphore/</link><pubDate>Thu, 29 Oct 2026 00:00:00 -0300</pubDate><guid>https://cassiobotaro.dev/en/posts/go-concurrency-semaphore/</guid><description>&lt;video
 src="https://cassiobotaro.dev/videos/semaforo.mp4"
 title="Ten tasks competing for three slots" aria-label="Ten tasks competing for three slots"
 autoplay
 loop
 muted
 playsinline
 controls
 preload="metadata"
 style="width: 100%; height: auto;"&gt;
&lt;/video&gt;

&lt;p&gt;In the &lt;a href="https://cassiobotaro.dev/en/posts/go-concurrency-worker-pool/" &gt;worker pool&lt;/a&gt; I fixed how many goroutines exist. In &lt;a href="https://cassiobotaro.dev/en/posts/go-concurrency-backpressure/" &gt;backpressure&lt;/a&gt; a channel&amp;rsquo;s capacity held the producer back.&lt;/p&gt;
&lt;p&gt;But what if I have ten files to download, and the server kicks out anyone who opens more than three connections? I want one goroutine per file, and only three of them downloading at the same time.&lt;/p&gt;</description></item><item><title>Go Concurrency - Backpressure</title><link>https://cassiobotaro.dev/en/posts/go-concurrency-backpressure/</link><pubDate>Tue, 27 Oct 2026 00:00:00 -0300</pubDate><guid>https://cassiobotaro.dev/en/posts/go-concurrency-backpressure/</guid><description>&lt;video
 src="https://cassiobotaro.dev/videos/backpressure.mp4"
 title="A bounded queue between the producer and a slow consumer" aria-label="A bounded queue between the producer and a slow consumer"
 autoplay
 loop
 muted
 playsinline
 controls
 preload="metadata"
 style="width: 100%; height: auto;"&gt;
&lt;/video&gt;

&lt;p&gt;In the &lt;a href="https://cassiobotaro.dev/en/posts/go-concurrency-tee/" &gt;tee&lt;/a&gt; a 250 millisecond worker held back the other one and the generator along with it, and the program took 2.5 seconds. I said that had a name and that it would come back.&lt;/p&gt;
&lt;p&gt;Here it is.&lt;/p&gt;
&lt;h2 id="what-backpressure-is"&gt;
 What backpressure is
 &lt;a class="heading-link" href="#what-backpressure-is"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Backpressure is when a slow consumer makes the producer slow down, instead of letting the work pile up without limit. Nothing gets dropped, and the one who waits is the producer.&lt;/p&gt;</description></item></channel></rss>