Async Classe

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

public final class Async

Méthodes d’assistance Asyc et CompletableFuture.

Résumé de la méthode

Modificateur et type Méthode et description
static java.util.concurrent.CompletableFuture<T> <T>completeExceptionally(Throwable ex)

Construit unCompletable terminé exceptionnellement.

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

Exécute un bloc qui retourne uneFuture complet et intercepte toutes les exceptions afin de retourner correctement un résultat exceptionnel terminé.

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

Exécute un bloc et retourne unCompletable avec la valeur de retour ou l’exception (complèteExceptionnellement).

Méthodes héritées de 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

Détails de la méthode

<T>completeExceptionally

public static CompletableFuture completeExceptionally(Throwable ex)

Construit un CompletableFuture terminé exceptionnellement.

Paramètres:

ex - Exception.

Retours:

CompletableFuture avec l’exception.

<T>tryCompletable

public static CompletableFuture tryCompletable(ThrowSupplier> supplier)

Exécute un bloc qui retourne un CompletableFuture et intercepte toutes les exceptions afin de retourner correctement un résultat exceptionnel terminé.

Paramètres:

supplier - Bloc à exécuter.

Retours:

The CompletableFuture

<T>wrapBlock

public static CompletableFuture wrapBlock(ThrowSupplier supplier)

Exécute un bloc et retourne un CompletableFuture avec la valeur de retour ou l’exception (completeExceptionally).

Paramètres:

supplier - Bloc à exécuter.

Retours:

The CompletableFuture

S’applique à