コード例 #1
0
ファイル: WorkerService.cs プロジェクト: semihokur/BuildXL
        /// <summary>
        /// Class constructor
        /// </summary>
        /// <param name="appLoggingContext">Application-level logging context</param>
        /// <param name="maxProcesses">the maximum number of concurrent pips on the worker</param>
        /// <param name="config">Distribution config</param>\
        /// <param name="buildId">the build id</param>
        public WorkerService(LoggingContext appLoggingContext, int maxProcesses, IDistributionConfiguration config, string buildId)
        {
            m_isGrpcEnabled = config.IsGrpcEnabled;

            m_appLoggingContext = appLoggingContext;
            m_maxProcesses      = maxProcesses;
            m_port     = config.BuildServicePort;
            m_services = new DistributionServices(buildId);
            if (m_isGrpcEnabled)
            {
                m_workerServer = new Grpc.GrpcWorkerServer(this, appLoggingContext, buildId);
            }
            else
            {
#if !DISABLE_FEATURE_BOND_RPC
                m_bondWorkerService = new InternalBond.BondWorkerServer(appLoggingContext, this, m_port, m_services);
                m_workerServer      = m_bondWorkerService;
#endif
            }

            m_attachCompletionSource    = TaskSourceSlim.Create <bool>();
            m_exitCompletionSource      = TaskSourceSlim.Create <bool>();
            m_workerRunnablePipObserver = new WorkerRunnablePipObserver(this);
            m_sendThread = new Thread(SendBuildResults);
        }
コード例 #2
0
        /// <summary>
        /// Class constructor
        /// </summary>
        /// <param name="appLoggingContext">Application-level logging context</param>
        /// <param name="maxProcesses">the maximum number of concurrent pips on the worker</param>
        /// <param name="config">Distribution config</param>\
        /// <param name="buildId">the build id</param>
        public WorkerService(LoggingContext appLoggingContext, int maxProcesses, IDistributionConfiguration config, string buildId)
        {
            m_appLoggingContext = appLoggingContext;
            m_maxProcesses      = maxProcesses;
            m_port         = config.BuildServicePort;
            m_services     = new DistributionServices(buildId);
            m_workerServer = new Grpc.GrpcWorkerServer(this, appLoggingContext, buildId);

            m_attachCompletionSource    = TaskSourceSlim.Create <bool>();
            m_exitCompletionSource      = TaskSourceSlim.Create <bool>();
            m_workerRunnablePipObserver = new WorkerRunnablePipObserver(this);
            m_sendThread = new Thread(SendBuildResults);
        }