Scheduled JobsHere is an example of how to schedule jobs using MEF as the Common Service Locator.
Common Service LocatorThe
Common Service Locator is used internally to build objects. You must setup common service locator to use your favorite IoC tool.
Here is an example using
MEF
var catalog = new DirectoryCatalog(AppDomain.CurrentDomain.BaseDirectory);
ServiceLocator.SetLocatorProvider(() =>
{
var container = new CompositionContainer(catalog);
return new MefServiceLocator(container);
});
You must set the Common Service Locator before you use anything in the CloudEngine. Note: You generally only need to do this for your worker role. The Azure Toolkit generally doesn't use the Common Service Locator for anything in a web role or other type of client application. You can find all the service locators that will work with your favorite IoC tool
here under the heading "Service locator adapter implementations".
Queue CommandsAdding Messages QueuesTable StorageBlob Storage