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


TypeScript service.cp.Client类代码示例

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


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

示例1: startWatching

	public startWatching(): () => void /* dispose */ {
		const client = new Client(
			uri.parse(require.toUrl('bootstrap')).fsPath,
			{
				serverName: 'Watcher',
				args: ['--type=watcherService'],
				env: {
					AMD_ENTRYPOINT: 'vs/workbench/services/files/node/watcher/unix/watcherApp',
					PIPE_LOGGING: 'true',
					VERBOSE_LOGGING: this.verboseLogging
				}
			}
		);

		const service = client.getService<WatcherService>('WatcherService', WatcherService);

		// Start watching
		service.watch({ basePath: this.basePath, ignored: this.ignored, verboseLogging: this.verboseLogging }).then(null, (err) => {
			if (!(err instanceof Error && err.name === 'Canceled' && err.message === 'Canceled')) {
				return TPromise.wrapError(err); // the service lib uses the promise cancel error to indicate the process died, we do not want to bubble this up
			}
		}, (events: IRawFileChange[]) => this.onRawFileEvents(events)).done(() => {

			// our watcher app should never be completed because it keeps on watching. being in here indicates
			// that the watcher process died and we want to restart it here.
			if (!this.isDisposed) {
				this.startWatching();
			}
		}, this.errorLogger);

		return () => {
			client.dispose();
			this.isDisposed = true;
		};
	}
开发者ID:BMGburger,项目名称:vscode,代码行数:35,代码来源:watcherService.ts

示例2: createService

function createService() {
	const server = new Client(
		uri.parse(require.toUrl('bootstrap')).fsPath,
		{
			serverName: 'TestServer',
			env: { AMD_ENTRYPOINT: 'vs/base/test/node/service/testApp', verbose: true }
		}
	);

	return server.getService<TestService>('TestService', TestService);
}
开发者ID:1424667164,项目名称:vscode,代码行数:11,代码来源:service.test.ts

示例3: test

	test('createService', function(done: () => void) {
		this.timeout(5000);

		const server = new Client(
			uri.parse(require.toUrl('bootstrap')).fsPath,
			{
				serverName: 'TestServer',
				env: { AMD_ENTRYPOINT: 'vs/base/test/node/service/testApp', verbose: true }
			}
		);

		const testService = server.getService<TestService>('TestService', TestService);
		const res = testService.pong('ping');

		res.then(r => {
			assert.equal(r.incoming, 'ping');
			assert.equal(r.outgoing, 'pong');
			done();
		});
	});
开发者ID:gaoxiaojun,项目名称:vscode,代码行数:20,代码来源:service.test.ts

示例4:

		return () => {
			client.dispose();
			this.isDisposed = true;
		};
开发者ID:gaoxiaojun,项目名称:vscode,代码行数:4,代码来源:watcherService.ts


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