I am very new to Azure Service Fabric.
My scenario is that I have a long-running service that I need to launch/stop multiple instances dynamically, and the launch should be non-block. Each of the instance will process 1 data entry independently. For example:
Say I have a weather service that keeps pulling weather data for each city, and is long-running. And I have a list of cities that can change. So, I want to do the following thing:
var weatherSvcList = new List...
var currentCities = [];
while (true)
{
var newCities = FetchCities();
var addedCities = newCities.Except(currentCities);
weatherSvcList = LaunchSvc(addedCities); // launch and return, non-blocking
var removedCities = currentCities.Except(newCities);
weatherSvcList = StopSvc(removedCities);
weatherSvcList = RelaunchErrorSvc(cities);
currentCities = newCities;
}
I've looked into Actor model, but seems like Actors are not suited for long-running task, and also it's hard to start/stop them. Any idea what service/programming model I should use?