Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(511)

Unified Diff: lib/src/client.dart

Issue 810333007: Add a done getter to Client, Server, and Peer. (Closed) Base URL: git@github.com:dart-lang/json_rpc_2@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « CHANGELOG.md ('k') | lib/src/peer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/client.dart
diff --git a/lib/src/client.dart b/lib/src/client.dart
index f3c63ca97d34e71e8c9f6f1bd3796b8c298795a4..f63fde6cb8ca4d60d2299dcdb0bb0624d191f048 100644
--- a/lib/src/client.dart
+++ b/lib/src/client.dart
@@ -32,6 +32,11 @@ class Client {
/// completed with those requests' responses.
final _pendingRequests = new Map<int, Completer>();
+ /// Returns a [Future] that completes when the connection is closed.
+ ///
+ /// This is the same future that's returned by [listen].
+ Future get done => _streams.done;
+
/// Creates a [Client] that writes requests to [requests] and reads responses
/// from [responses].
///
« no previous file with comments | « CHANGELOG.md ('k') | lib/src/peer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698