1
1
package net .jodah .failsafe ;
2
2
3
3
import java .util .concurrent .Callable ;
4
- import java .util .concurrent .CompletableFuture ;
5
4
import java .util .concurrent .Semaphore ;
6
- import java .util .function .BiConsumer ;
7
5
8
6
import net .jodah .failsafe .function .AsyncCallable ;
9
7
import net .jodah .failsafe .function .AsyncRunnable ;
@@ -155,7 +153,7 @@ public T call() throws Exception {
155
153
try {
156
154
execution .before ();
157
155
asyncFutureLock .acquire ();
158
- callable .call (execution ).whenComplete (new BiConsumer <T , Throwable >() {
156
+ callable .call (execution ).whenComplete (new java . util . function . BiConsumer <T , Throwable >() {
159
157
@ Override
160
158
public void accept (T innerResult , Throwable failure ) {
161
159
try {
@@ -187,7 +185,7 @@ static <T> AsyncCallableWrapper<T> asyncOfFuture(final Callable<java.util.concur
187
185
public T call () throws Exception {
188
186
try {
189
187
execution .before ();
190
- callable .call ().whenComplete (new BiConsumer <T , Throwable >() {
188
+ callable .call ().whenComplete (new java . util . function . BiConsumer <T , Throwable >() {
191
189
@ Override
192
190
public void accept (T innerResult , Throwable failure ) {
193
191
// Unwrap CompletionException cause
@@ -213,7 +211,7 @@ static <T> AsyncCallableWrapper<T> asyncOfFuture(
213
211
public T call () throws Exception {
214
212
try {
215
213
execution .before ();
216
- callable .call (execution ).whenComplete (new BiConsumer <T , Throwable >() {
214
+ callable .call (execution ).whenComplete (new java . util . function . BiConsumer <T , Throwable >() {
217
215
@ Override
218
216
public void accept (T innerResult , Throwable failure ) {
219
217
// Unwrap CompletionException cause
@@ -264,16 +262,6 @@ public T call() throws Exception {
264
262
};
265
263
}
266
264
267
- static <T > CompletableFuture <T > cancellableFutureOf (final FailsafeFuture <T > future ) {
268
- return new CompletableFuture <T >() {
269
- @ Override
270
- public boolean cancel (boolean mayInterruptIfRunning ) {
271
- future .cancel (mayInterruptIfRunning );
272
- return super .cancel (mayInterruptIfRunning );
273
- }
274
- };
275
- }
276
-
277
265
static <T , U , R > CheckedBiFunction <T , U , R > fnOf (final Callable <R > callable ) {
278
266
return new CheckedBiFunction <T , U , R >() {
279
267
@ Override
0 commit comments