| 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.resubscribable; | |
| 6 | |
| 7 import 'dart:async'; | 5 import 'dart:async'; |
| 8 | 6 |
| 9 import '../watcher.dart'; | 7 import '../watcher.dart'; |
| 10 import 'watch_event.dart'; | 8 import 'watch_event.dart'; |
| 11 | 9 |
| 12 typedef ManuallyClosedWatcher WatcherFactory(); | 10 typedef ManuallyClosedWatcher WatcherFactory(); |
| 13 | 11 |
| 14 /// A wrapper for [ManuallyClosedWatcher] that encapsulates support for closing | 12 /// A wrapper for [ManuallyClosedWatcher] that encapsulates support for closing |
| 15 /// the watcher when it has no subscribers and re-opening it when it's | 13 /// the watcher when it has no subscribers and re-opening it when it's |
| 16 /// re-subscribed. | 14 /// re-subscribed. |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 /// An interface for watchers with an explicit, manual [close] method. | 66 /// An interface for watchers with an explicit, manual [close] method. |
| 69 /// | 67 /// |
| 70 /// See [ResubscribableWatcher]. | 68 /// See [ResubscribableWatcher]. |
| 71 abstract class ManuallyClosedWatcher implements Watcher { | 69 abstract class ManuallyClosedWatcher implements Watcher { |
| 72 /// Closes the watcher. | 70 /// Closes the watcher. |
| 73 /// | 71 /// |
| 74 /// Subclasses should close their [events] stream and release any internal | 72 /// Subclasses should close their [events] stream and release any internal |
| 75 /// resources. | 73 /// resources. |
| 76 void close(); | 74 void close(); |
| 77 } | 75 } |
| OLD | NEW |