Class AlpacaFutures

java.lang.Object
markets.alpaca.client.rest.AlpacaFutures

public final class AlpacaFutures extends Object
Adapters from generated *Async(..., ApiCallback<T>) REST methods to CompletableFuture.

Generated Broker, Market Data, and Trading clients each define their own ApiCallback and ApiException types. These overloads keep those generated types intact while letting application code use futures:


 CompletableFuture<Account> future =
     AlpacaFutures.trading(callback -> accountsApi.getAccountAsync(callback));
 

Cancelling the returned future cancels the underlying OkHttp Call.