thuri commented on code in PR #8785:
URL: https://github.com/apache/camel/pull/8785#discussion_r1033946639


##########
core/camel-support/src/main/java/org/apache/camel/support/task/BackgroundTask.java:
##########
@@ -167,12 +147,14 @@ private boolean waitForTaskCompletion(CountDownLatch 
latch, Future<?> task) {
         } finally {
             elapsed = budget.elapsed();
         }
-
-        return completed;
     }
 
     @Override
     public Duration elapsed() {
         return elapsed;
     }
+
+    private static class ExecutionResult {
+        private boolean completed;

Review Comment:
   Fair point and also a good idea. From what I understand I'd say that 
`BackgroundTask` is stateful because of the `budget` and the `elapsed` fields. 
Especially the `next()` method probably has side effects on the state of the 
budget.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to