Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getAsync* methods are actually synchronous #31

Open
mircea-cm opened this issue Jan 30, 2024 · 1 comment
Open

getAsync* methods are actually synchronous #31

mircea-cm opened this issue Jan 30, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@mircea-cm
Copy link

mircea-cm commented Jan 30, 2024

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

@namankhurpia
Copy link
Owner

@mircea-cm you are absolutely right, making a PR for this right now, should be fixed easily

@namankhurpia namankhurpia self-assigned this Feb 15, 2024
@namankhurpia namankhurpia added the bug Something isn't working label Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants