Service which runs "forever"? RRS feed

  • Question

  • How can I design a Service so that it runs "forever" and just sends a notification when something interesting happened; e.g. polling some sensors and just send a notification if the values are out of normal?


    What is a good way do increase reliability; e.g. should the service be recycled from time to time?

    Wednesday, August 29, 2007 11:45 AM


  • Hi, by default, our services are meant to be long running, consuming zero CPU if nothing happens. We have many, many example so fsensor services, or orchestrator/fusion services that just subscribe to other services or to low level hardware wrappers, and when something interesting happens, update their state, then send a notification through their subscription manager. YOu can send notifications on anything you think is appropriate, as along as you also update your state to update the reason for th enotification (notifications in our model are nothing more than state changes).



    Your service can periodically persist its state as well, so if it fails un-expectedly, when it restarts it will continue form where it left off. Our service tutorials show examples of this as well.


    I recommend viewing are on-demand video tutorials on services, or reading through our service tutorials. They have relevant examples.





    Wednesday, August 29, 2007 1:58 PM