rubenlagus / TelegramBots

Java library to create bots using Telegram Bots API
https://telegram.me/JavaBotsApi
MIT License
4.77k stars 1.22k forks source link

SilentSender.executeAsync and execute are identical #602

Open recursiveribbons opened 5 years ago

recursiveribbons commented 5 years ago

Checking the source code of SilentSender.executeAsync and SilentSender.execute reveals that they have identical implementations. Async should be async, like AbsSender.executeAsync.

recursiveribbons commented 5 years ago

I am working on a patch based on CompletableFuture here: https://github.com/recursiveribbons/TelegramBots/commit/39869d9eba2b81602f1e6c32804361dbeedd5590

Chase22 commented 5 years ago

The pull request has been closed by you. Is this fixed or still opened @recursiveribbons

recursiveribbons commented 5 years ago

@Chase22

It's been a while, can't really remember.

I think I was having doubts about whether CompletableFuture is the best solution here

addo47 commented 5 years ago

SilentSender was never meant to do anything smarter than gobbling the error and returning the proper object if exist in an Optional. Tho, I dislike how in the async variant, we won't be able to test for an empty optional. Whoever is going to use it will practically be totally fine with not handling any kind of error.