eljojo / telegram_bot

A charismatic Ruby client for Telegram's Bot API
MIT License
298 stars 82 forks source link

threading support? #6

Open icy opened 9 years ago

icy commented 9 years ago

Can you please support a way to process multiple bot commands at the same time?

Thanks.

eljojo commented 9 years ago

This is definitely in my list of things to support. I've been wondering about what's the best solution about it.

I like a lot the "actor" pattern that celluloid brings, maybe i'll play with that. What's your current usecase?

I am open for discussion about this.

icy commented 9 years ago

I like a lot the "actor" pattern that celluloid brings, maybe i'll play with that.

You may take a look at Cinch (https://github.com/cinchrb/cinch) which is Ruby framework to write IRC bots. That's very robust and easy; and I used to have my IRC bots written in Cinch, e.g, https://github.com/archlinuxvn/irclog/tree/master/bot.

What's your current usecase?

My bot often processes many commands at the same time, e.g, it executes system command uptime, grep,... and returns the output to user. It's important to stop other users from waiting these commands.

Thanks a lot!

UPDATE: Fix typo errors.