bytesnake / telebot

Write Telegram bots in Rust with Tokio and Futures
Other
212 stars 33 forks source link

Change tokio_core::Handle to generic Executor #64

Closed PvdBerg1998 closed 5 years ago

PvdBerg1998 commented 5 years ago

Currently, Bot requires a tokio_core::Handle. I'm using futures 0.3 however, and since it seems you just use the handle to spawn tasks, it could accept a generic futures::future::Executor. This trait is implemented for tokio_core::Handle, so it's backwards compatible, and also forward compatible, since it's trivial to write a compatibility layer between my futures 0.3 executor and your crate.

bytesnake commented 5 years ago

Sorry to hear that you had difficulties using the new 0.3 version of futures, I know how difficult it is two mix both versions with telebot :/ For now I have no time to implement backward support and the status quo is that we will just wait for the new futures release to arrive. It would be awesome if you could create a PR which changes the necessary bits, though I hope the impl's won't be to complicated ..

PvdBerg1998 commented 5 years ago

Since I was already using hyper in another part of my code, I decided to just communicate with telegrams REST interface manually. Therefore I didn't make any changes to your code and I don't have the time to update it unfortunately.

bytesnake commented 5 years ago

ok then I'll postpone this, until futures 0.3 is released