public override async Task Link() { List <IWorkerGrain> receivers = to.Layer.Values.SelectMany(x => x).ToList(); List <IWorkerGrain> senders = from.Layer.Values.SelectMany(x => x).ToList(); foreach (var pair in from.Layer) { ISendStrategy strategy = new Shuffle(jsonLambda, batchSize); foreach (var receiver_pair in to.Layer) { if (receiver_pair.Key.Equals(pair.Key)) { strategy.AddReceivers(receiver_pair.Value, true); } else { strategy.AddReceivers(receiver_pair.Value); } } foreach (IWorkerGrain grain in pair.Value) { await grain.SetSendStrategy(id, strategy); } } }