File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed
src/main/java/com/enigmabridge/retry Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change 1
1
package com .enigmabridge .retry ;
2
2
3
3
/**
4
+ * Future object, similar to {@link java.util.concurrent.Future}
5
+ *
6
+ * Used in async job invocations. Can be used to detect if task is running or
7
+ * finished. Caller can cancel the task or skip current backoff waiting interval.
8
+ *
4
9
* Created by dusanklinec on 21.07.16.
5
10
*/
6
11
public interface EBFuture <Result , Error > {
12
+ /**
13
+ * Returns true if async task is still running.
14
+ * @return true if running
15
+ */
7
16
boolean isRunning ();
17
+
18
+ /**
19
+ * Returns true if async task finished its execution.
20
+ * @return true if done
21
+ */
8
22
boolean isDone ();
23
+
24
+ /**
25
+ * Triggers cancellation of the task.
26
+ * Does not interrupt currently running job, disables invocation of the next attempt.
27
+ */
9
28
void cancel ();
29
+
30
+ /**
31
+ * If task is currently waiting in a backoff interval, this interrupts waiting and
32
+ * immediately executes the task - skipping the waiting interval.
33
+ * Like "Retry now" button in UI.
34
+ */
10
35
void runNow ();
11
36
}
Original file line number Diff line number Diff line change 1
1
package com .enigmabridge .retry ;
2
2
3
3
/**
4
+ * Retry Job implementation with job error = Throwable.
5
+ *
6
+ * Moreover all uncaught exceptions thrown in the job body are caught and considered as fail().
7
+ *
4
8
* Created by dusanklinec on 25.07.16.
5
9
*/
6
10
public abstract class EBRetryJobSimpleSafeThrErr <Result > extends EBRetryJobSimpleSafe <Result , Throwable > {
You can’t perform that action at this time.
0 commit comments