Skip to content

Commit

Permalink
Deployed 64c1c32 with MkDocs version: 1.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Unknown committed Sep 6, 2024
1 parent 64c1c32 commit 638f396
Show file tree
Hide file tree
Showing 4 changed files with 131 additions and 109 deletions.
26 changes: 24 additions & 2 deletions changelog/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1190,8 +1190,30 @@ <h3 id="v53000_uncut">v5.30.0.0 (uncut)<a class="headerlink" href="#v53000_uncut
<ul>
<li><strong>http4k-</strong>* : Upgrade some dependency versions.</li>
<li><strong>http4k-multipart</strong> : [Fix] Further fixes to deletion of temporary files. Should fix memory leak. @H/T @oharaandrew314</li>
<li><strong>http4k-</strong>* : [Breaking] Make WsMessage mode explicit, and fix many binary frame errors. The<code>WSMessage</code> object signature will need to be migrated to the new form as we have had to make some adjustments to handle binary modes, but should be quite easy. @H/T @oharaandrew314</li>
</ul>
<li><strong>http4k-server-jetty11</strong> : [Fix] Received binary Websocket frames will no longer have their content coerced to text. @H/T @oharaandrew314</li>
<li><strong>http4k-</strong>* : [Breaking] Make <code>WsMessage</code> mode explicit. @H/T @oharaandrew314</li>
</ul>
<h4 id="migration_guide">Migration Guide<a class="headerlink" href="#migration_guide" title="Permanent link">&para;</a></h4>
<p>Previously, a <code>WsMessage</code> was sent in either <code>TEXT</code> or <code>BINARY</code> mode based on whether the <code>Body</code> was a <code>MemoryBody</code> or <code>StreamBody</code>, respectively.
N</p>
<p>:warning: <strong>Warning:</strong> If you were using the primary constructor of <code>WsMessage</code>, you will need to explicitly provide a <code>WsMessage.Mode</code> to resolve the new compiler errors.</p>
<div class="codehilite"><pre><span></span><code><span class="kd">val</span><span class="w"> </span><span class="nv">textMessage</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">WsMessage</span><span class="p">(</span><span class="n">MemoryBody</span><span class="p">(</span><span class="s">&quot;hi&quot;</span><span class="p">),</span><span class="w"> </span><span class="n">WsMessage</span><span class="p">.</span><span class="na">Mode</span><span class="p">.</span><span class="na">Text</span><span class="p">)</span>
<span class="kd">val</span><span class="w"> </span><span class="nv">binaryMessage</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">WsMessage</span><span class="p">(</span><span class="n">StreamBody</span><span class="p">(</span><span class="n">imageStream</span><span class="p">),</span><span class="w"> </span><span class="n">WsMessage</span><span class="p">.</span><span class="na">Mode</span><span class="p">.</span><span class="na">Binary</span><span class="p">)</span>
</code></pre></div>

<p>:bulb: <strong>Note:</strong> If you were using the secondary <code>WsMessage</code> constructors, no changes are necessary.</p>
<div class="codehilite"><pre><span></span><code><span class="kd">val</span><span class="w"> </span><span class="nv">textMessage</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">WsMessage</span><span class="p">(</span><span class="s">&quot;hi&quot;</span><span class="p">)</span><span class="w"> </span><span class="c1">// Text like before</span>
<span class="kd">val</span><span class="w"> </span><span class="nv">binaryMessage</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">WsMessage</span><span class="p">(</span><span class="n">imageStream</span><span class="p">)</span><span class="w"> </span><span class="c1">// Binary like before</span>
</code></pre></div>

<p>:bulb: <strong>Note:</strong> You now have full control over how content is sent.</p>
<div class="codehilite"><pre><span></span><code><span class="c1">// have a very long string? Stream it!</span>
<span class="kd">val</span><span class="w"> </span><span class="nv">lotsOfText</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">WsMessage</span><span class="p">(</span><span class="n">StreamBody</span><span class="p">(</span><span class="n">imageStream</span><span class="p">),</span><span class="w"> </span><span class="n">WsMessage</span><span class="p">.</span><span class="na">Mode</span><span class="p">.</span><span class="na">Text</span><span class="p">)</span>

<span class="c1">// have your binary buffered already? Send it as is!</span>
<span class="kd">val</span><span class="w"> </span><span class="nv">bufferedBinary</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">WsMessage</span><span class="p">(</span><span class="n">MemoryBody</span><span class="p">(</span><span class="n">imageBytes</span><span class="p">),</span><span class="w"> </span><span class="n">WsMessage</span><span class="p">.</span><span class="na">Mode</span><span class="p">.</span><span class="na">Binary</span><span class="p">)</span>
</code></pre></div>

<h3 id="v52900">v5.29.0.0<a class="headerlink" href="#v52900" title="Permanent link">&para;</a></h3>
<ul>
<li><strong>http4k-</strong>* : Upgrade some dependency versions including Kotlin to 2.0.20</li>
Expand Down
2 changes: 1 addition & 1 deletion search/search_index.json

Large diffs are not rendered by default.

Loading

0 comments on commit 638f396

Please sign in to comment.