Skip to main content

Web Processes

As of the time of writing this document, Microsoft Azure does not support .NET 4.5.2 and the QueueBackgroundWorkItem object. The Eleflex.EleflexWebProcess object uses a simple timer object to routinely run a background process until the Microsoft Azure platform supports an upgraded framework.

This example shows how to create a startup task that creates a background web process.


public class ExampleProcessStartupTask : StartupTask
{
        protected EleflexWebProcess _exampleProcess = null;
        public ExampleProcessStartupTask() : base()
        {
            Description = "This task starts the example background process.";
            Priority = StartupConstants.PRIORITY_CUSTOM;
        }       
        public override bool Start(ITaskOptions taskOptions)
        {
            if (_exampleProcess == null)
            {
                _exampleProcess = new EleflexWebProcess(60000, //Run every minute (high priority)
                    () =>
                    {
                        try
                        {
                            //Do work here
                        }
                        catch { }
                    });
         }
}