I have a telegram bot made only in ruby , to execute the bot I have a binary file that run my ruby files. The most important part is listen for new messages from user.
Telegram::Bot::Client.run(token) do |bot|
bot.listen do |message|
call other methods here
But now I want to move from this plain ruby project , for a rails app because I want to start developing more complex features.
So how can I make a task that is always running this listener? I read a little about ActiveJob and Sidekiq, but I don't know how/if is possible to achieve this.
Create a background task that is always running
nr: #1 dodano: 2017-05-12 11:05
ActiveJob and Sidekiq are not what you need. Those are to perform finite jobs in the background. You need some kind of a daemon that starts independently of Rails app.
Take a look at this https://github.com/thuehlinger/daemons