bytesnake/telebot

Change tokio_core::Handle to generic Executor

Closed this issue · 3 comments

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.

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 ..

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.

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