当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript fs.unwatchFile函数代码示例

本文整理汇总了TypeScript中fs.unwatchFile函数的典型用法代码示例。如果您正苦于以下问题:TypeScript unwatchFile函数的具体用法?TypeScript unwatchFile怎么用?TypeScript unwatchFile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了unwatchFile函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: setTimeout

    const onSourceChanged = (curr: fs.Stats, prev :fs.Stats) => {
      // console.log(process.pid, 'server changed')
      for (let filename of selfSourceFiles) {
        fs.unwatchFile(filename)
      }

      for (let filename of sourceFiles) {
        fs.unwatchFile(filename)
      }

      if (process.env.IS_SUBPROCESS) {
        process.exit(0)
        return
      }

      if (isClosing) {
        return
      }
      isClosing = true

      if (httpServer) {
        // console.log(process.pid, 'closing server', httpServer.listening)
        httpServer.close(() => {
          setTimeout(restartAsSubproc, 100)
        })
        httpServer.unref()
      } else {
        setTimeout(restartAsSubproc, 100)
      }
    }
开发者ID:rsms,项目名称:co,代码行数:30,代码来源:parse-debugger.ts

示例2: watchFile

 watchFile('testfile', {persistent: false, interval: 1000}, (curr, prev) => {
   expect(curr.size).toBe(16);
   expect(prev.size).toBe(12);
   expect(zoneASpec.onScheduleTask).toHaveBeenCalled();
   expect(Zone.current.name).toBe('A');
   unwatchFile('testfile');
   unlink('testfile', () => {
     done();
   });
 });
开发者ID:jahtalab,项目名称:zone.js,代码行数:10,代码来源:fs.spec.ts

示例3: unwatchFile

      .then(() => {
        unwatchFile(readyFile);

        // We have to watch for errors until the tunnel has started
        // successfully at which point we only want to watch for
        // status messages to emit
        readMessage = readStatus;

        readRunningMessage('');
        readMessage = undefined;
      })
开发者ID:theintern,项目名称:digdug,代码行数:11,代码来源:SauceLabsTunnel.ts

示例4: watchFile

      watchFile(readyFile, { persistent: false, interval: 1007 }, function(
        current,
        previous
      ) {
        if (Number(current.mtime) === Number(previous.mtime)) {
          // readyFile hasn't been modified, so ignore the event
          return;
        }

        unwatchFile(readyFile);
        resolve();
      });
开发者ID:theintern,项目名称:digdug,代码行数:12,代码来源:TestingBotTunnel.ts

示例5: close

                watchFile: (fileName, callback) => {
                    // watchFile polls a file every 250ms, picking up file notifications.
                    _fs.watchFile(fileName, { persistent: true, interval: 250 }, fileChanged);

                    return {
                        close() { _fs.unwatchFile(fileName, fileChanged); }
                    };

                    function fileChanged(curr: any, prev: any) {
                        if (+curr.mtime <= +prev.mtime) {
                            return;
                        }

                        callback(fileName);
                    };
                },
开发者ID:GrimoireGL,项目名称:atom-typescript,代码行数:16,代码来源:sys.ts

示例6:

 close: () => _fs.unwatchFile(fileName, fileChanged)
开发者ID:8Observer8,项目名称:TypeScript,代码行数:1,代码来源:sys.ts

示例7: unwatch

	/** Clears callbacks added with onModify(). */
	unwatch() {
		fs.unwatchFile(this.path);
	}
开发者ID:AdmiralZachbar,项目名称:Pokemon-Showdown,代码行数:4,代码来源:fs.ts


注:本文中的fs.unwatchFile函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。