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

Unified Diff: watcher/lib/watcher.dart

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 years, 2 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 | « watcher/lib/src/watch_event.dart ('k') | watcher/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: watcher/lib/watcher.dart
diff --git a/watcher/lib/watcher.dart b/watcher/lib/watcher.dart
deleted file mode 100644
index 79dcc0daef31ad1256fc2950bde86e055d1b5309..0000000000000000000000000000000000000000
--- a/watcher/lib/watcher.dart
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library watcher;
-
-import 'dart:async';
-import 'dart:io';
-
-import 'src/watch_event.dart';
-import 'src/directory_watcher.dart';
-import 'src/file_watcher.dart';
-
-export 'src/watch_event.dart';
-export 'src/directory_watcher.dart';
-export 'src/directory_watcher/polling.dart';
-export 'src/file_watcher.dart';
-export 'src/file_watcher/polling.dart';
-
-abstract class Watcher {
- /// The path to the file or directory whose contents are being monitored.
- String get path;
-
- /// The broadcast [Stream] of events that have occurred to the watched file or
- /// files in the watched directory.
- ///
- /// Changes will only be monitored while this stream has subscribers. Any
- /// changes that occur during periods when there are no subscribers will not
- /// be reported the next time a subscriber is added.
- Stream<WatchEvent> get events;
-
- /// Whether the watcher is initialized and watching for changes.
- ///
- /// This is true if and only if [ready] is complete.
- bool get isReady;
-
- /// A [Future] that completes when the watcher is initialized and watching for
- /// changes.
- ///
- /// If the watcher is not currently monitoring the file or directory (because
- /// there are no subscribers to [events]), this returns a future that isn't
- /// complete yet. It will complete when a subscriber starts listening and the
- /// watcher finishes any initialization work it needs to do.
- ///
- /// If the watcher is already monitoring, this returns an already complete
- /// future.
- Future get ready;
-
- /// Creates a new [DirectoryWatcher] or [FileWatcher] monitoring [path],
- /// depending on whether it's a file or directory.
- ///
- /// If a native watcher is available for this platform, this will use it.
- /// Otherwise, it will fall back to a polling watcher. Notably, watching
- /// individual files is not natively supported on Windows, although watching
- /// directories is.
- ///
- /// If [pollingDelay] is passed, it specifies the amount of time the watcher
- /// will pause between successive polls of the contents of [path]. Making this
- /// shorter will give more immediate feedback at the expense of doing more IO
- /// and higher CPU usage. Defaults to one second. Ignored for non-polling
- /// watchers.
- factory Watcher(String path, {Duration pollingDelay}) {
- if (new File(path).existsSync()) {
- return new FileWatcher(path, pollingDelay: pollingDelay);
- } else {
- return new DirectoryWatcher(path, pollingDelay: pollingDelay);
- }
- }
-}
« no previous file with comments | « watcher/lib/src/watch_event.dart ('k') | watcher/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698