Async Clase

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

public final class Async

Métodos auxiliares Asyc y CompletableFuture.

Resumen del método

Modificador y tipo Método y descripción
static java.util.concurrent.CompletableFuture<T> <T>completeExceptionally(Throwable ex)

Construye un completoFuture completado excepcionalmente.

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

Ejecuta un bloque que devuelve unaCompletableFuture y detecta las excepciones para devolver correctamente un resultado excepcional completado.

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

Ejecuta un bloque y devuelve unaCompletable Future con el valor devuelto o la excepción (completoExcepcionalmente).

Métodos heredados 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

Detalles del método

<T>completeExceptionally

public static CompletableFuture completeExceptionally(Throwable ex)

Construye un CompletableFuture completado excepcionalmente.

Parámetros:

ex - Excepción.

Devoluciones:

CompletableFuture con la excepción.

<T>tryCompletable

public static CompletableFuture tryCompletable(ThrowSupplier> supplier)

Ejecuta un bloque que devuelve completableFuture y detecta las excepciones para devolver correctamente un resultado excepcional completado.

Parámetros:

supplier - Bloque que se va a ejecutar.

Devoluciones:

The CompletableFuture

<T>wrapBlock

public static CompletableFuture wrapBlock(ThrowSupplier supplier)

Ejecuta un bloque y devuelve completableFuture con el valor devuelto o la excepción (completeExceptionalmente).

Parámetros:

supplier - Bloque que se va a ejecutar.

Devoluciones:

The CompletableFuture

Se aplica a