Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-6672

EJB's async methods' Future#get should treat zero timeout as "don't wait"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 10.1.0.CR1, 10.1.0.Final
    • 8.2.0.Final
    • EJB
    • None

      Say there is an asynchronous EJB method:

      @Asynchronous
      public Future<Boolean> method() {
         ...
      }
      

      Calling Future#get with a zero timeout:

      if (bean.method().get(0, TimeUnit.MILLISECONDS))
      

      results in a block until the task is finished.
      Instead I expected zero waiting, because java.util.concurrent.Future.get(long, TimeUnit) doesn't specify any special treatment for a zero timeout value.

            sdouglas1@redhat.com Stuart Douglas
            vsevolodgol Vsevolod Golovanov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: