| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library watcher.directory_watcher.resubscribable; | 5 library watcher.directory_watcher.resubscribable; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:io'; | |
| 9 | 8 |
| 10 import '../directory_watcher.dart'; | 9 import '../directory_watcher.dart'; |
| 11 import '../utils.dart'; | |
| 12 import '../watch_event.dart'; | 10 import '../watch_event.dart'; |
| 13 | 11 |
| 14 typedef ManuallyClosedDirectoryWatcher WatcherFactory(); | 12 typedef ManuallyClosedDirectoryWatcher WatcherFactory(); |
| 15 | 13 |
| 16 /// A wrapper for [ManuallyClosedDirectoryWatcher] that encapsulates support for | 14 /// A wrapper for [ManuallyClosedDirectoryWatcher] that encapsulates support for |
| 17 /// closing the watcher when it has no subscribers and re-opening it when it's | 15 /// closing the watcher when it has no subscribers and re-opening it when it's |
| 18 /// re-subscribed. | 16 /// re-subscribed. |
| 19 /// | 17 /// |
| 20 /// It's simpler to implement watchers without worrying about this behavior. | 18 /// It's simpler to implement watchers without worrying about this behavior. |
| 21 /// This class wraps a watcher class which can be written with the simplifying | 19 /// This class wraps a watcher class which can be written with the simplifying |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 /// An interface for watchers with an explicit, manual [close] method. | 68 /// An interface for watchers with an explicit, manual [close] method. |
| 71 /// | 69 /// |
| 72 /// See [ResubscribableDirectoryWatcher]. | 70 /// See [ResubscribableDirectoryWatcher]. |
| 73 abstract class ManuallyClosedDirectoryWatcher implements DirectoryWatcher { | 71 abstract class ManuallyClosedDirectoryWatcher implements DirectoryWatcher { |
| 74 /// Closes the watcher. | 72 /// Closes the watcher. |
| 75 /// | 73 /// |
| 76 /// Subclasses should close their [events] stream and release any internal | 74 /// Subclasses should close their [events] stream and release any internal |
| 77 /// resources. | 75 /// resources. |
| 78 void close(); | 76 void close(); |
| 79 } | 77 } |
| OLD | NEW |