language agnostic - What's the best way to notify a non-web application about a change on a web page? -
Assume that I have two applications that work simultaneously to a certain extent.
- A desktop application (Java, C ++, ...)
Desktop application should not be notified by web application And the period between sending and receiving notifications should be low. (& Lt; 10 seconds)
What are the possible ways to do this? I can think of voting in 10 second intervals, but if many desktop applications have to be notified it will produce a lot of traffic. I use a UDP broadcast on a LAN, but unfortunately it is not possible here ...
I appreciate whatever ideas I can give you.
I think the "best practice" here will depend on the number of desktop clients you expect to service We do. If only one desktop has been notified, then voting can be a good way - yes, voting is much more than an incident-based notification, but it will definitely be the easiest way to implement.
If the upper part of the poll is unacceptable, then I have two basic options:
- Desktop and web-server (A "comet" style web request may be made, Or a raw socket connection)
- Open a service from within the desktop app, and register the service address with a web server. In this way, the web server may call the desktop as needed.
WARNING, though - both options are similar. Some highlights:
- Open connections can be difficult because you want your web server to become hot -space
- Calling an external service (such as , Your desktop) is dangerous to a web server because this request may hang. You would like to take this notification to a different thread so that you can avoid the webserver.
To minimize some concerns, you can post an update from the web server to an untrusted desktop to an intermediary notification server - the web server, and the desktop is notified for voting. Can connect / register. Here to avoid changing the wheel again, it may contain some types of messageQuee system ... it certainly connects the complexity of the need to maintain a new arbitrator.
Again, all of these approaches are probably quite complex, so I would say that perhaps voting is the best bet.
Comments
Post a Comment