Register
Wednesday, February 08, 2012
 
Support this site Minimize
 
 
 
  
 
 Best PracticesWorker Role
  
Best Practices Minimize
   
 
  
 
Worker Role Best Practices Minimize
 

Worker roles are kind of like simplified Windows Services. The default Worker Role project comes with two methods defined. One, Start(), is called when the Worker Role is first started. The default code for that method does nothing more than sleep 10 seconds and record an entry in the Cloud Log. The other, GetHealthStatus(), is a method that gets called every so often to determine whether the Worker Role is having issues. The default is to return a Healthy status and is used to determine whether to restart the Worker Role.

Many people will tell you that debugging Worker Roles is hard for lots of reasons. I'm here to tell you that it isn't true, you just need to change your opinion of what a Worker Role is.

A Worker Role is nothing but a Wrapper for a DLL that does all of the work.

The Worker Role should handle logging via a callback from the processing DLL.

A template of the worker role I use can be found in the forums, here.

 
 
 Print   
 
Privacy Statement | Terms Of Use Copyright 2009-2010 by Azure-Architect.com