Daemons

Use deamons to carry out background jobs that should occur in a regular interval, for instance to search for broken links, to act as a notification service, etc.

Daemons are created the same way as plugins; as a .cs or .vb class and included in the project or referenced as a class library.

Example of a daemon

using Mindroute.Core.Daemons;

namespace Lemoon.DaemonTest {
    [Serializable]
    public class MyDaemon : Daemon {
        public override void Run() {
            //Do something
        }
    }
}

 

Creating daemons

Create a new class in your project or in a seperate class library. Add references the Mindroute.Core.Daemons namespace and let the class inherit the Daemons class. All daemons must be serializable, so make sure to decorate the class with the [Serializable] attribute.

The only method you need to implement is the public abstract void Run() function. So, override that method and implement the functionality that should be carried out when the daemon runs.

When you have created the daemon, login to the editorial interface to enable it and set an interval when the daemon should run. The interval is set as a time span. So, if you would like to run the daemon every hour, set the interval to 01:00. If you would like to run the daemon every 10 minutes, set the interval to 00:10.