Package dev.failsafe

Class AsyncExecutionImpl<R>

    • Field Detail

      • asyncExecution

        private final boolean asyncExecution
      • policyPostExecuted

        private final boolean[] policyPostExecuted
      • recorded

        private volatile boolean recorded
    • Method Detail

      • complete

        public void complete()
        Description copied from interface: AsyncExecution
        Completes the execution and the associated CompletableFuture.
        Specified by:
        complete in interface AsyncExecution<R>
      • isComplete

        public boolean isComplete()
        Description copied from interface: AsyncExecution
        Returns whether the execution is complete or if it can be retried. An execution is considered complete only when all configured policies consider the execution complete.
        Specified by:
        isComplete in interface AsyncExecution<R>
      • record

        public void record​(R result,
                           java.lang.Throwable exception)
        Description copied from interface: AsyncExecution
        Records an execution result or exception which triggers failure handling, if needed, by the configured policies. If policy handling is not possible or already complete, the resulting CompletableFuture is completed.
        Specified by:
        record in interface AsyncExecution<R>
      • recordResult

        public void recordResult​(R result)
        Description copied from interface: AsyncExecution
        Records an execution result which triggers failure handling, if needed, by the configured policies. If policy handling is not possible or already complete, the resulting CompletableFuture is completed.
        Specified by:
        recordResult in interface AsyncExecution<R>
      • recordException

        public void recordException​(java.lang.Throwable exception)
        Description copied from interface: AsyncExecution
        Records an exception which triggers failure handling, if needed, by the configured policies. If policy handling is not possible or already complete, the resulting CompletableFuture is completed.
        Specified by:
        recordException in interface AsyncExecution<R>
      • executeAsync

        void executeAsync()
        Performs an asynchronous execution.
      • complete

        private void complete​(ExecutionResult<R> result,
                              java.lang.Throwable error)