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
|
||||
|
||||
* 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
|
||||
/// be allowed to complete.
|
||||
Future<Null> shutdown() {
|
||||
if (_isShutdown) return new Future.value();
|
||||
Future<void> shutdown() async {
|
||||
if (_isShutdown) return;
|
||||
_isShutdown = true;
|
||||
return _connection.shutdown();
|
||||
if (_connection != null) await _connection.shutdown();
|
||||
}
|
||||
|
||||
/// Terminates this channel.
|
||||
///
|
||||
/// RPCs already in progress will be terminated. No further RPCs can be made
|
||||
/// on this channel.
|
||||
Future<Null> terminate() {
|
||||
Future<void> terminate() async {
|
||||
_isShutdown = true;
|
||||
return _connection.terminate();
|
||||
if (_connection != null) await _connection.terminate();
|
||||
}
|
||||
|
||||
/// Returns a connection to this [Channel]'s RPC endpoint.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
name: grpc
|
||||
description: Dart implementation of gRPC.
|
||||
version: 0.6.7
|
||||
version: 0.6.8
|
||||
author: Dart Team <misc@dartlang.org>
|
||||
homepage: https://github.com/dart-lang/grpc-dart
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue