Reputation: 2446
I am using Visual Studio 2010 to develop Azure applications. I want to start a worker role inside of another worker role. Is this possible? Just like threads, I want to create another worker instance while the application is running. Can anyone help me? I am new to Azure platform and C#
Upvotes: 1
Views: 514
Reputation: 467
Why don't you create a webrole that acts as a master and gives work to worker instances. Workers then run the program and send the output back to the webrole. Web role can then do the needful. The webrole and workerrole can talk through queues.
Upvotes: 0
Reputation: 4842
I think your level of abstraction may be a bit off. Think of a worker role as a physical machine, not something like a windows service.
Once it's running you can do anything you would on a standard server so instead of "like threading", just do threading. (Personally I recommend using the .NET4 Task Parallel Library, it's awesome ;) )
Upvotes: 1
Reputation: 9399
The short answer is no you can't create a worker role inside another worker role.
You can use a worker role to control other worker roles through the management API (including deploying a service) which may be what you're trying to do.
It is possible that you can achieve what you're trying to do with threads without having to create a whole separate worker role role instance. Could you give us a little more information about what you're trying to do?
Upvotes: 0