I'm building a service which basically allows users to chat with a bot, and the bot then does some strange processing with the chat sent by the user, and eventually reply back with some meaningful data. Basically something similar to how Aardvark used (?) to work.
I've the bot working, and listening right now, and I have a separate rails app that will be doing all the other heavy lifting. Both these parts are working fine individually, and now I'm stuck at interfacing the two. My idea is to interface the bot (which is basically a small ruby script) with the rails app via Resque - anything that comes in goes to a queue, gets picked up, and the results then pushed back again to the queue, and then the script would reply back with the results.
I'm not very clear as to how to establish this interface:
I know these might be very trivial questions, but I'm having a hard time understanding which works better, and how to get the setup going.
There are three ways to communicate between your Rails app and this bot daemon:
When you are enqueuing and pulling Resque jobs off various Job queues, you're just reading/writing to the shared Redis database through an API. Both the bot and the Rails app talk to the Redis DB over the network.
I recommend running the bot directly as a ruby process or rake task managed by monit. It sounds like you already know how to do this.