We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 531d935 commit 8dbd622Copy full SHA for 8dbd622
src/main/java/javascalautils/concurrent/PromiseImpl.java
@@ -16,6 +16,7 @@
16
package javascalautils.concurrent;
17
18
import static javascalautils.TryCompanion.Failure;
19
+import static javascalautils.TryCompanion.Try;
20
import static javascalautils.TryCompanion.Success;
21
22
import java.util.concurrent.atomic.AtomicBoolean;
@@ -160,7 +161,9 @@ public String toString() {
160
161
*/
162
private boolean tryComplete(Consumer<FutureImpl<T>> c) {
163
if (completed.compareAndSet(false, true)) {
- c.accept(future);
164
+ //This Try is only here to manage any unforeseen exception raised by the Future event listener
165
+ //See issue#41
166
+ Try(() -> c.accept(future));
167
return true;
168
}
169
return false;
0 commit comments