Yeni bir CompletableFuture döner. Açıklaması şöyle
Exceptionally completes this CompletableFuture with TimeoutException if not otherwise completed before the given timeout.
Belirtilen süre kadar bekler. Eğer iş bitmediyse bile bile future TimeoutException ile biter.
ÖrnekŞöyle yaparızCompletableFuture<Void> f1 = ...
CompletableFuture<Void> f2 = f1.orTimeout(TIMEOUT_IN_MILLIS, TimeUnit.MILLISECONDS);
Hiç yorum yok:
Yorum Gönder