public Task ReceiveControlEvent <TGrainInterface, TState, TEvent>(SpatialGrain <TGrainInterface, TState> spatialGrain, TEvent controlEvent) where TGrainInterface : ISpatialGrain where TState : SpatialGrainState, new() where TEvent : ControlEvent { if (typeof(TEvent) == typeof(SetParentEvent)) { var e = controlEvent as SetParentEvent; _partition = e.Partition; } else { throw new System.NotImplementedException(); } return(Task.CompletedTask); }
private Task ProcessForwardCommandQueue(Queue <ForwardCommand> queue) { var currentPartitionId = ""; IGridPartitionGrain currentPartitionGrain = null; foreach (var cmd in queue) { // ForwardCommands for the same partition are in order, therefore cache the current partition if (cmd.PartitionId != currentPartitionId || currentPartitionGrain == null) { currentPartitionGrain = GrainFactory.GetGrain <IGridPartitionGrain>(cmd.PartitionId); currentPartitionId = cmd.PartitionId; } // TODO: currentPartitionGrain... } return(Task.CompletedTask); }