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

Unified Diff: sdk/lib/async/stream.dart

Issue 256233005: Update documentation of StreamSubscription.cancel. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 6 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/async/stream.dart
diff --git a/sdk/lib/async/stream.dart b/sdk/lib/async/stream.dart
index 4b29de8c0a6f842b926557b54f5f9eb7b23e961a..e612b9cc5ff4dcfdca883c3674193407d74c13f6 100644
--- a/sdk/lib/async/stream.dart
+++ b/sdk/lib/async/stream.dart
@@ -1168,11 +1168,13 @@ abstract class StreamSubscription<T> {
/**
* Cancels this subscription. It will no longer receive events.
*
- * If an event is currently firing, this unsubscription will only
- * take effect after all subscribers have received the current event.
- *
- * Returns a future if the cancel-operation is not completed synchronously.
- * Otherwise returns `null`.
+ * May return a future which completes when the stream is done cleaning up.
+ * This can be used if the stream needs to release some resources
+ * that are needed for a following operation,
+ * for example a file being read, that should be deleted afterwards.
+ * In that case, the file may not be able to be deleted successfully
+ * until the returned future has completed.
+ * Returns `null` if there is no need to wait.
*/
Future cancel();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698