diff options
author | Jan Tattermusch <jtattermusch@google.com> | 2016-06-03 16:34:48 -0700 |
---|---|---|
committer | Jan Tattermusch <jtattermusch@google.com> | 2016-06-06 13:21:10 -0700 |
commit | 49fb84ab643fd1a676c526482b6e3960046262b9 (patch) | |
tree | 575e1971ba1aa9302e769f6e199d04913b32fbd9 | |
parent | 87ec3b77b54c392a68dfeb7e6a73e44ab26059b2 (diff) |
rename ChannelState.FatalFailure to ChannelState.Shutdown
-rw-r--r-- | src/csharp/Grpc.Core.Tests/ChannelTest.cs | 6 | ||||
-rw-r--r-- | src/csharp/Grpc.Core/Channel.cs | 14 | ||||
-rw-r--r-- | src/csharp/Grpc.Core/ChannelState.cs | 2 |
3 files changed, 11 insertions, 11 deletions
diff --git a/src/csharp/Grpc.Core.Tests/ChannelTest.cs b/src/csharp/Grpc.Core.Tests/ChannelTest.cs index 850d70ce92..db0ef3a4cd 100644 --- a/src/csharp/Grpc.Core.Tests/ChannelTest.cs +++ b/src/csharp/Grpc.Core.Tests/ChannelTest.cs @@ -71,7 +71,7 @@ namespace Grpc.Core.Tests public void WaitForStateChangedAsync_InvalidArgument() { var channel = new Channel("localhost", ChannelCredentials.Insecure); - Assert.ThrowsAsync(typeof(ArgumentException), async () => await channel.WaitForStateChangedAsync(ChannelState.FatalFailure)); + Assert.ThrowsAsync(typeof(ArgumentException), async () => await channel.WaitForStateChangedAsync(ChannelState.Shutdown)); channel.ShutdownAsync().Wait(); } @@ -102,11 +102,11 @@ namespace Grpc.Core.Tests } [Test] - public async Task StateIsFatalFailureAfterShutdown() + public async Task StateIsShutdownAfterShutdown() { var channel = new Channel("localhost", ChannelCredentials.Insecure); await channel.ShutdownAsync(); - Assert.AreEqual(ChannelState.FatalFailure, channel.State); + Assert.AreEqual(ChannelState.Shutdown, channel.State); } [Test] diff --git a/src/csharp/Grpc.Core/Channel.cs b/src/csharp/Grpc.Core/Channel.cs index 886adfec33..2ec763bec1 100644 --- a/src/csharp/Grpc.Core/Channel.cs +++ b/src/csharp/Grpc.Core/Channel.cs @@ -104,7 +104,7 @@ namespace Grpc.Core /// <summary> /// Gets current connectivity state of this channel. - /// After channel is has been shutdown, <c>ChannelState.FatalFailure</c> will be returned. + /// After channel is has been shutdown, <c>ChannelState.Shutdown</c> will be returned. /// </summary> public ChannelState State { @@ -121,8 +121,8 @@ namespace Grpc.Core /// </summary> public Task WaitForStateChangedAsync(ChannelState lastObservedState, DateTime? deadline = null) { - GrpcPreconditions.CheckArgument(lastObservedState != ChannelState.FatalFailure, - "FatalFailure is a terminal state. No further state changes can occur."); + GrpcPreconditions.CheckArgument(lastObservedState != ChannelState.Shutdown, + "Shutdown is a terminal state. No further state changes can occur."); var tcs = new TaskCompletionSource<object>(); var deadlineTimespec = deadline.HasValue ? Timespec.FromDateTime(deadline.Value) : Timespec.InfFuture; var handler = new BatchCompletionDelegate((success, ctx) => @@ -172,7 +172,7 @@ namespace Grpc.Core /// <summary> /// Allows explicitly requesting channel to connect without starting an RPC. /// Returned task completes once state Ready was seen. If the deadline is reached, - /// or channel enters the FatalFailure state, the task is cancelled. + /// or channel enters the Shutdown state, the task is cancelled. /// There is no need to call this explicitly unless your use case requires that. /// Starting an RPC on a new channel will request connection implicitly. /// </summary> @@ -182,9 +182,9 @@ namespace Grpc.Core var currentState = GetConnectivityState(true); while (currentState != ChannelState.Ready) { - if (currentState == ChannelState.FatalFailure) + if (currentState == ChannelState.Shutdown) { - throw new OperationCanceledException("Channel has reached FatalFailure state."); + throw new OperationCanceledException("Channel has reached Shutdown state."); } await WaitForStateChangedAsync(currentState, deadline).ConfigureAwait(false); currentState = GetConnectivityState(false); @@ -264,7 +264,7 @@ namespace Grpc.Core } catch (ObjectDisposedException) { - return ChannelState.FatalFailure; + return ChannelState.Shutdown; } } diff --git a/src/csharp/Grpc.Core/ChannelState.cs b/src/csharp/Grpc.Core/ChannelState.cs index d293b98f75..a6c3b2a488 100644 --- a/src/csharp/Grpc.Core/ChannelState.cs +++ b/src/csharp/Grpc.Core/ChannelState.cs @@ -64,6 +64,6 @@ namespace Grpc.Core /// <summary> /// Channel has seen a failure that it cannot recover from /// </summary> - FatalFailure + Shutdown } } |