title: Paralell loading of data in JSF
body: <p>I have a JSF/Primefaces page where I display the content of a table. In this table there are the results of a timer which tests every 15 minutes the accessibility of some related services. I also have a refresh button beneath the table which starts the test directly. The tests for some services may take very long and the page doesn't freeze while testing.</p>
  <p>I want to know, if it would be possible to start those test asynchronous all paralell and the page shows if a test for a service ist still running, or if it has a result.</p>
  <p>I know it could be difficult for a table but if you think it is too complicatet than it would be nice if it would be possible to show that the test-function is still running.</p>
  <p>Simplified Code:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;h:form id=&quot;statusfrm&quot;&gt;
    &lt;div class=&quot;card&quot;&gt;
      &lt;p:dataTable var=&quot;sys&quot; value=&quot;#{statushandler.availableList}&quot;
        showGridlines=&quot;true&quot; size=&quot;small&quot;&gt;
          &lt;p:column headerText=&quot;System&quot;&gt;
            &lt;h:outputText value=&quot;#{sys.systemName}&quot; /&gt;
          &lt;/p:column&gt;
          &lt;p:column headerText=&quot;Verfügbarkeit&quot;&gt;
            &lt;h:outputText value=&quot;#{sys.availability}&quot; /&gt;
          &lt;/p:column&gt;
          &lt;p:column headerText=&quot;Letzte Prüfung&quot;&gt;
            &lt;h:outputText value=&quot;#{sys.lastUpdate}&quot; rendered=&quot;#{not sys.requestPending}&quot;/&gt;
            &lt;h:outputText value=&quot;Pending...&quot; rendered=&quot;#{sys.requestPending}&quot;/&gt;
          &lt;/p:column&gt;
        &lt;/p:dataTable&gt;
      &lt;/div&gt;
      &lt;p:commandButton value=&quot;Neu laden&quot; icon=&quot;pi  pi-refresh&quot; 
        actionListener=&quot;#{statushandler.refreshParameter}&quot;/&gt;
  &lt;/h:form&gt;
  </code></pre>
  <p>And in the statushandler</p>
  <pre class="lang-java prettyprint-override"><code>    public String refreshParameter() {
          Async: Interface1.checkSystem();
          Async: Interface2.checkSystem();
          Async: Interface3.checkSystem();
          Async: Interface4.checkSystem();
          return null;
      }
  
  </code></pre>
  <p>The objective is that everytime the user returns to the page with the table the system knows that there are pending requests for some systems.</p>
  <p>But I will try also the solution with <code>@Inject @Push</code> this also looks useful.</p>