mirror of https://github.com/grpc/grpc-dart.git
don't throw on closing channel not open (#128)
Don't throw on closing channel not open
This commit is contained in:
parent
c252ada1a5
commit
921f4df0b9
|
|
@ -1,3 +1,8 @@
|
||||||
|
## 0.6.8
|
||||||
|
|
||||||
|
* Calling `terminate()` or `shutdown()` on a channel doesn't throw error if the
|
||||||
|
channel is not yet open.
|
||||||
|
|
||||||
## 0.6.7
|
## 0.6.7
|
||||||
|
|
||||||
* Support package:test 1.5.
|
* Support package:test 1.5.
|
||||||
|
|
|
||||||
|
|
@ -44,19 +44,19 @@ class ClientChannel {
|
||||||
///
|
///
|
||||||
/// No further RPCs can be made on this channel. RPCs already in progress will
|
/// No further RPCs can be made on this channel. RPCs already in progress will
|
||||||
/// be allowed to complete.
|
/// be allowed to complete.
|
||||||
Future<Null> shutdown() {
|
Future<void> shutdown() async {
|
||||||
if (_isShutdown) return new Future.value();
|
if (_isShutdown) return;
|
||||||
_isShutdown = true;
|
_isShutdown = true;
|
||||||
return _connection.shutdown();
|
if (_connection != null) await _connection.shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Terminates this channel.
|
/// Terminates this channel.
|
||||||
///
|
///
|
||||||
/// RPCs already in progress will be terminated. No further RPCs can be made
|
/// RPCs already in progress will be terminated. No further RPCs can be made
|
||||||
/// on this channel.
|
/// on this channel.
|
||||||
Future<Null> terminate() {
|
Future<void> terminate() async {
|
||||||
_isShutdown = true;
|
_isShutdown = true;
|
||||||
return _connection.terminate();
|
if (_connection != null) await _connection.terminate();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns a connection to this [Channel]'s RPC endpoint.
|
/// Returns a connection to this [Channel]'s RPC endpoint.
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
name: grpc
|
name: grpc
|
||||||
description: Dart implementation of gRPC.
|
description: Dart implementation of gRPC.
|
||||||
version: 0.6.7
|
version: 0.6.8
|
||||||
author: Dart Team <misc@dartlang.org>
|
author: Dart Team <misc@dartlang.org>
|
||||||
homepage: https://github.com/dart-lang/grpc-dart
|
homepage: https://github.com/dart-lang/grpc-dart
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue