Open mircea-cm opened 5 months ago
All getAsync methods are actually synchronous.
For example, getAsyncChatCompletion (in AsyncDAOImpl) returns a POJO object: ChatCompletionResponse, and it should return a Future.
You create a CompletableFuture (all well for now), but the method ends in
return (ChatCompletionResponse)future.get();
Basically, it blocks the current thread until the future completes.
For the methods to be actually async they need to return Call<> or Future
@mircea-cm you are absolutely right, making a PR for this right now, should be fixed easily
All getAsync methods are actually synchronous.
For example, getAsyncChatCompletion (in AsyncDAOImpl) returns a POJO object: ChatCompletionResponse, and it should return a Future.
You create a CompletableFuture (all well for now), but the method ends in
return (ChatCompletionResponse)future.get();
Basically, it blocks the current thread until the future completes.
For the methods to be actually async they need to return Call<> or Future