I have several WorkerRole
that only do job for a short time, and it would be a waste of money to put them in a single instance each. We could merge them in a single one, but it'd be a mess and in the far future they are supposed to work independently when the load increases.
Is there a way to create a "multi role" WorkerRole
in the same way you can create a "multi site" WebRole
?
In negative case, I think I can create a "master worker role", that is able to load the assemblies from a given folder, look for RoleEntryPoint derivated classes with reflection, create instances and invoke the .Run()
or .OnStart()
method. This "master worker role" will also rethrown unexpected exceptions, and call .OnStop()
in all sub RoleEntryPoint
s when .OnStop()
is called in the master one. Would it work? What should I be aware of?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…