Ejemplo n.º 1
0
            static Task <BuildResponse> ProcessCompilationRequestCore(ICompilerServerHost compilerServerHost, BuildRequest buildRequest, CancellationToken cancellationToken)
            {
                Func <BuildResponse> func = () =>
                {
                    var request  = BuildProtocolUtil.GetRunRequest(buildRequest);
                    var response = compilerServerHost.RunCompilation(request, cancellationToken);
                    return(response);
                };

                var task = new Task <BuildResponse>(func, cancellationToken, TaskCreationOptions.LongRunning);

                task.Start();
                return(task);
            }
        private Task <BuildResponse> ServeBuildRequestAsync(BuildRequest buildRequest, CancellationToken cancellationToken)
        {
            Func <BuildResponse> func = () =>
            {
                var request  = BuildProtocolUtil.GetRunRequest(buildRequest);
                var response = _compilerServerHost.RunCompilation(request, cancellationToken);
                return(response);
            };

            var task = new Task <BuildResponse>(func, cancellationToken, TaskCreationOptions.LongRunning);

            task.Start();
            return(task);
        }
Ejemplo n.º 3
0
        protected virtual Task <BuildResponse> ServeBuildRequest(BuildRequest buildRequest, CancellationToken cancellationToken)
        {
            Func <BuildResponse> func = () =>
            {
                // Do the compilation
                Log("Begin compilation");

                var request  = BuildProtocolUtil.GetRunRequest(buildRequest);
                var response = _compilerServerHost.RunCompilation(request, cancellationToken);

                Log("End compilation");
                return(response);
            };

            var task = new Task <BuildResponse>(func, cancellationToken, TaskCreationOptions.LongRunning);

            task.Start();
            return(task);
        }