private async Task <IMessageSerializationGrain> GetGrainOnOtherSilo() { if (this.grainOnOtherSilo != null) { return(this.grainOnOtherSilo); } // Find a grain on another silo. IMessageSerializationGrain otherGrain; var id = this.GetPrimaryKeyLong(); var currentSiloIdentity = await this.GetSiloIdentity(); while (true) { otherGrain = this.GrainFactory.GetGrain <IMessageSerializationGrain>(++id); var otherIdentity = await otherGrain.GetSiloIdentity(); if (!string.Equals(otherIdentity, currentSiloIdentity)) { break; } } return(this.grainOnOtherSilo = otherGrain); }
public ExceptionPropagationTests(ITestOutputHelper output, Fixture fixture) { this.output = output; this.fixture = fixture; var grainFactory = (IInternalGrainFactory)this.fixture.GrainFactory; this.exceptionGrain = grainFactory.GetGrain <IMessageSerializationGrain>(GetRandomGrainId()); this.clientObjectRef = grainFactory.CreateObjectReference <IMessageSerializationClientObject>(this.clientObject); }