public async Task DuplicateActivations() { const int nRunnerGrains = 100; const int nTargetGrain = 10; const int startingKey = 1000; const int nCallsToEach = 100; var runnerGrains = new ICatalogTestGrain[nRunnerGrains]; var promises = new List <Task>(nRunnerGrains); for (int i = 0; i < nRunnerGrains; i++) { runnerGrains[i] = this.fixture.GrainFactory.GetGrain <ICatalogTestGrain>(-i); promises.Add(runnerGrains[i].Initialize()); } await Task.WhenAll(promises); promises.Clear(); for (int i = 0; i < nRunnerGrains; i++) { promises.Add(runnerGrains[i].BlastCallNewGrains(nTargetGrain, startingKey, nCallsToEach)); } await Task.WhenAll(promises); }
public void DuplicateActivations() { const int nRunnerGrains = 100; const int nTargetGRain = 10; const int startingKey = 1000; const int nCallsToEach = 100; var runnerGrains = new ICatalogTestGrain[nRunnerGrains]; var promises = new List<Task>(); for (int i = 0; i < nRunnerGrains; i++) { runnerGrains[i] = GrainClient.GrainFactory.GetGrain<ICatalogTestGrain>(i.ToString(CultureInfo.InvariantCulture)); promises.Add(runnerGrains[i].Initialize()); } Task.WhenAll(promises).Wait(); promises.Clear(); for (int i = 0; i < nRunnerGrains; i++) { promises.Add(runnerGrains[i].BlastCallNewGrains(nTargetGRain, startingKey, nCallsToEach)); } Task.WhenAll(promises).Wait(); }
public void DuplicateActivations() { const int nRunnerGrains = 100; const int nTargetGRain = 10; const int startingKey = 1000; const int nCallsToEach = 100; var runnerGrains = new ICatalogTestGrain[nRunnerGrains]; var promises = new List <Task>(); for (int i = 0; i < nRunnerGrains; i++) { runnerGrains[i] = GrainClient.GrainFactory.GetGrain <ICatalogTestGrain>(i.ToString(CultureInfo.InvariantCulture)); promises.Add(runnerGrains[i].Initialize()); } Task.WhenAll(promises).Wait(); promises.Clear(); for (int i = 0; i < nRunnerGrains; i++) { promises.Add(runnerGrains[i].BlastCallNewGrains(nTargetGRain, startingKey, nCallsToEach)); } Task.WhenAll(promises).Wait(); }