Friday, September 23, 2016

Azure Service Fabric: Activate an actor on startup

I’m currently working on a project where we are using Azure Service Fabric and the reliable actors component. We had a situation where we wanted to create and activate a set of actors the moment the actor service is started. In our first attempt we added this logic inside the program.cs:

This is actually a bad idea as we are not taking the actor service lifecycle into account. The correct place to activate our actors is inside the RunAsync method of our actor service:

No comments: