Reputation: 235
Question 1: While publishing a worker role having while(true) block in its Run() method will it ensure that on successful completion of publish - the worker role will automatically start?
If no, then how to start it?
Question 2: If the worker role for some reason after starting has stooped - how to restart it?
Upvotes: 0
Views: 198
Reputation: 30903
Question 1: While publishing a worker role having while(true) block in its Run() method will it ensure that on successful completion of publish - the worker role will automatically start?
Yes. All Cloud Service
deployments start automatically. And your code shall never exit the Run()
method. Should your code by any reason leave the Run()
method, the role will be automatically recycled
.
Question 2: If the worker role for some reason after starting has stooped - how to restart it?
The Windows Azure Fabric Controller takes care of such situations. There is way for a role to be stopped by some reason
. The only way to suspend
a role (worker or web) is to explicitly require that from the Management API or the portal.
Check this article for more info.
Upvotes: 1