<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>reactive &amp;mdash; StealthyCoder</title>
    <link>https://stealthycoder.writeas.com/tag:reactive</link>
    <description>Making code ninjas out of everyone</description>
    <pubDate>Sun, 19 Apr 2026 04:36:05 +0000</pubDate>
    <item>
      <title>Stay clear of the void</title>
      <link>https://stealthycoder.writeas.com/stay-clear-of-the-void?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[So I learned this the hard way, but in reactive programming, aka my WebFlux project. Do not ever use Void as a type. Just wrap it in something you can propagate like Object, String or Boolean or something else. !--more--&#xA;&#xA;It gets really difficult, like impossible, do to things like return a MonoVoid that actually is returning some object. You cannot return null as that will internally by construed to be an empty Mono and won&#39;t trigger downstream. So that goes out the window, how about instantiating one via Void.TYPE.newInstance() ? Well that is not without it&#39;s own problems. It is deprecated and most likely can fail in any number of reasons plus make your code really unmanageable. &#xA;&#xA;Never ever ever ever use it ?&#xA;&#xA;Well you can if you know it is the end of the line, but for instance doing a .onErrorResume(FunctionThrowable, ? extends Void) is not a cool thing to do. Even if a Mono.then() will fix the problem it just makes everything so unnecessarily complex.&#xA;&#xA;#java #reactive]]&gt;</description>
      <content:encoded><![CDATA[<p>So I learned this the hard way, but in reactive programming, aka my WebFlux project. Do not ever use Void as a type. Just wrap it in something you can propagate like Object, String or Boolean or something else. </p>

<p>It gets really difficult, like impossible, do to things like return a <code>Mono&lt;Void&gt;</code> that actually is returning some object. You cannot return <code>null</code> as that will internally by construed to be an empty Mono and won&#39;t trigger downstream. So that goes out the window, how about instantiating one via <code>Void.TYPE.newInstance()</code> ? Well that is not without it&#39;s own problems. It is deprecated and most likely can fail in any number of reasons plus make your code really unmanageable.</p>

<h1 id="never-ever-ever-ever-use-it" id="never-ever-ever-ever-use-it">Never ever ever ever use it ?</h1>

<p>Well you can if you know it is the end of the line, but for instance doing a <code>.onErrorResume(Function&lt;Throwable, ? extends Void&gt;)</code> is not a cool thing to do. Even if a <code>Mono.then()</code> will fix the problem it just makes everything so unnecessarily complex.</p>

<p><a href="https://stealthycoder.writeas.com/tag:java" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">java</span></a> <a href="https://stealthycoder.writeas.com/tag:reactive" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">reactive</span></a></p>
]]></content:encoded>
      <guid>https://stealthycoder.writeas.com/stay-clear-of-the-void</guid>
      <pubDate>Wed, 22 Sep 2021 18:02:39 +0000</pubDate>
    </item>
  </channel>
</rss>