Async Classe

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

public final class Async

Metodi helper Asyc e CompletableFuture.

Riepilogo dei metodi

Modificatore e tipo Metodo e descrizione
static java.util.concurrent.CompletableFuture<T> <T>completeExceptionally(Throwable ex)

Costruisce unFuturo completabile completato in modo eccezionale.

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

Esegue un blocco che restituisce un oggetto CompletableFuture e intercetta eventuali eccezioni per restituire correttamente un risultato completato in modo eccezionale.

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

Esegue un blocco e restituisce unCompletable con il valore restituito o l'eccezione (completaEccezionale).

Metodi ereditati da 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

Dettagli metodo

<T>completeExceptionally

public static CompletableFuture completeExceptionally(Throwable ex)

Costruisce un CompletableFuture completato in modo eccezionale.

Parametri:

ex - Eccezione.

Restituisce:

CompletableFuture con l'eccezione.

<T>tryCompletable

public static CompletableFuture tryCompletable(ThrowSupplier> supplier)

Esegue un blocco che restituisce un completableFuture e intercetta tutte le eccezioni per restituire correttamente un risultato completato in modo eccezionale.

Parametri:

supplier - Blocco da eseguire.

Restituisce:

The CompletableFuture

<T>wrapBlock

public static CompletableFuture wrapBlock(ThrowSupplier supplier)

Esegue un blocco e restituisce un oggetto CompletableFuture con il valore restituito o l'eccezione (completeExceptionally).

Parametri:

supplier - Blocco da eseguire.

Restituisce:

The CompletableFuture

Si applica a