提交 0cde7af5 编写于 作者: D Daniel Imms

Make nsfw service watch call private

上级 661e2aa5
......@@ -18,8 +18,8 @@ nsfwActionToRawChangeType[nsfw.actions.MODIFIED] = FileChangeType.UPDATED;
nsfwActionToRawChangeType[nsfw.actions.DELETED] = FileChangeType.DELETED;
interface IWatcherObjet {
start(): void;
stop(): void;
start(): any;
stop(): any;
}
interface IPathWatcher {
......@@ -45,7 +45,7 @@ export class NsfwWatcherService implements IWatcherService {
return this._watcherPromise;
}
public watch(request: IWatcherRequest): TPromise<void> {
private _watch(request: IWatcherRequest): TPromise<void> {
let undeliveredFileEvents: watcher.IRawFileChange[] = [];
const fileEventDelayer = new ThrottledDelayer(NsfwWatcherService.FS_EVENT_DELAY);
......@@ -118,7 +118,6 @@ export class NsfwWatcherService implements IWatcherService {
return promise;
}
// TODO: This should probably be the only way to watch a folder
public setRoots(roots: IWatcherRequest[]): TPromise<void> {
const promises: TPromise<void>[] = [];
const normalizedRoots = this._normalizeRoots(roots);
......@@ -145,7 +144,7 @@ export class NsfwWatcherService implements IWatcherService {
});
// Start watching some roots
rootsToStartWatching.forEach(root => promises.push(this.watch(root)));
rootsToStartWatching.forEach(root => promises.push(this._watch(root)));
// Refresh ignored arrays in case they changed
roots.forEach(root => {
......
......@@ -10,13 +10,11 @@ import { TPromise } from 'vs/base/common/winjs.base';
export interface IWatcherRequest {
basePath: string;
ignored: string[];
// verboseLogging: boolean;
}
export interface IWatcherService {
initialize(verboseLogging: boolean): TPromise<void>;
setRoots(roots: IWatcherRequest[]): TPromise<void>;
watch(request: IWatcherRequest): TPromise<void>;
}
export interface IFileWatcher {
......
......@@ -12,7 +12,6 @@ import { IWatcherRequest, IWatcherService } from './watcher';
export interface IWatcherChannel extends IChannel {
call(command: 'initialize', verboseLogging: boolean): TPromise<void>;
call(command: 'setRoots', request: IWatcherRequest[]): TPromise<void>;
call(command: 'watch', request: IWatcherRequest): TPromise<void>;
call(command: string, arg: any): TPromise<any>;
}
......@@ -24,7 +23,6 @@ export class WatcherChannel implements IWatcherChannel {
switch (command) {
case 'initialize': return this.service.initialize(arg);
case 'setRoots': return this.service.setRoots(arg);
case 'watch': return this.service.watch(arg);
}
return undefined;
}
......@@ -41,8 +39,4 @@ export class WatcherChannelClient implements IWatcherService {
setRoots(roots: IWatcherRequest[]): TPromise<void> {
return this.channel.call('setRoots', roots);
}
watch(request: IWatcherRequest): TPromise<void> {
return this.channel.call('watch', request);
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册