Reputation: 2153
At the moment I have 2 projects. One is my bot which is a console application, which sends messages to my slack channel and listens into it. My second project is an .net MVC
application which listens to post request incoming from slack.
A typical round of communication would be the user typing play!
The bot would pick up play! and then it would send an interactive message with buttons. When the buttons are pressed, it sends a post request to my .net MVC
application which is deployed to azure.
I'm a little stuck at the moment. How do I get the web application to send a notification to my console application to simple begin the game?
At the moment when an interactive button is clicked and my MVC
app registers it, the MVC
application will make an entry into the database. My bot application is busy querying every 5 seconds to see if there's an entry in the database to play the game. A better solution would be greatly appreciated.
Upvotes: 0
Views: 878
Reputation: 5141
You could try SignalR on your ASP.NET application.
ASP.NET SignalR is a new library for ASP.NET developers that makes developing real-time web functionality easy. SignalR allows bi-directional communication between server and client. Servers can now push content to connected clients instantly as it becomes available. SignalR supports Web Sockets, and falls back to other compatible techniques for older browsers. SignalR includes APIs for connection management (for instance, connect and disconnect events), grouping connections, and authorization.
Basically, this is used for real-time notifications and chat applications.
Here's a sample for consuming it in a console application.
Upvotes: 1