I have a chatbot application that needs to finish its session X minutes after the latest message from user. I run a job each X minutes which I verify if the last message has been sent X minutes ago. Do you guys have some suggestion for that problem without a job use? I think something as a queue with a X minutes delay or something like that. What is a better way to do that?
If your chatbot is running on clients with javascript enabled, you can set and clear and reset a window timer on each key stroke...basically if the time goes off after x minutes, that means no key has been pressed, at that time you can do whatever is needed to close the application.
Read more about window.setTimout here: https://developer.mozilla.org/en-US/docs/Web/API/setTimeout