Async Klasse

  • java.lang.Object
    • com.microsoft.bot.connector.Async

public final class Async

Asyc- und CompletableFuture-Hilfsmethoden.

Methodenzusammenfassung

Modifizierer und Typ Methode und Beschreibung
static java.util.concurrent.CompletableFuture<T> <T>completeExceptionally(Throwable ex)

Erstellt eine kompletableFuture außergewöhnlich abgeschlossen.

static java.util.concurrent.CompletableFuture<T> <T>tryCompletable(ThrowSupplier<CompletableFuture<T>> supplier)

Führt einen Block aus, der ein kompletierbaresFuture zurückgibt, und fangen alle Ausnahmen ab, um ein abgeschlossenes außergewöhnliches Ergebnis ordnungsgemäß zurückzugeben.

static java.util.concurrent.CompletableFuture<T> <T>wrapBlock(ThrowSupplier<T> supplier)

Führt einen Block aus und gibt einen kompletierbarenFuture mit dem Rückgabewert oder der Ausnahme zurück (vollständigAusnahmsweise).

Geerbte Methoden von java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Details zur Methode

<T>completeExceptionally

public static CompletableFuture completeExceptionally(Throwable ex)

Erstellt eine CompletableFuture ausnahmsweise.

Parameter:

ex - Die Ausnahme.

Gibt zurück:

Ein CompletableFuture mit Ausnahme.

<T>tryCompletable

public static CompletableFuture tryCompletable(ThrowSupplier> supplier)

Führt einen Block aus, der ein CompletableFuture zurückgibt, und fängt alle Ausnahmen ab, um ein abgeschlossenes außergewöhnliches Ergebnis ordnungsgemäß zurückzugeben.

Parameter:

supplier - Der auszuführende Block.

Gibt zurück:

Die CompletableFuture

<T>wrapBlock

public static CompletableFuture wrapBlock(ThrowSupplier supplier)

Führt einen Block aus und gibt einen CompletableFuture-Wert mit dem Rückgabewert oder der Ausnahme (completeExceptionally) zurück.

Parameter:

supplier - Der auszuführende Block.

Gibt zurück:

Die CompletableFuture

Gilt für: