コード例 #1
0
        private static IIpcResult RPCSendCore(ConfiguredCommand conf, IClient rpc, bool isSync)
        {
            string operationPayload = ToPayload(conf);
            var    operation        = new IpcOperation(operationPayload, waitForServerAck: isSync);

            return(rpc.Send(operation).GetAwaiter().GetResult());
        }
コード例 #2
0
 /// <summary>
 /// Creates DaemonConfig using the values specified on the ConfiguredCommand
 /// </summary>
 public static DaemonConfig CreateDaemonConfig(ConfiguredCommand conf)
 {
     return(new DaemonConfig(
                logger: conf.Logger,
                moniker: conf.Get(Moniker),
                maxConnectRetries: conf.Get(MaxConnectRetries),
                connectRetryDelay: TimeSpan.FromMilliseconds(conf.Get(ConnectRetryDelayMillis)),
                stopOnFirstFailure: conf.Get(StopOnFirstFailure),
                enableCloudBuildIntegration: conf.Get(EnableCloudBuildIntegration)));
 }
コード例 #3
0
        /// <nodoc />
        protected static int RPCSend(ConfiguredCommand conf, IClient rpc, bool isSync)
        {
            var rpcResult = RPCSendCore(conf, rpc, isSync);

            conf.Logger.Info(
                "Command '{0}' {1} (exit code: {2}). {3}",
                conf.Command.Name,
                rpcResult.Succeeded ? "succeeded" : "failed",
                (int)rpcResult.ExitCode,
                rpcResult.Payload);
            return((int)rpcResult.ExitCode);
        }
コード例 #4
0
 /// <summary>
 /// Reconstructs a full command line corresponding to a <see cref="ConfiguredCommand"/>.
 /// </summary>
 private static string ToPayload(ConfiguredCommand cmd) => ToPayload(cmd.Command.Name, cmd.Config);
コード例 #5
0
 /// <nodoc />
 protected static int AsyncRPCSend(ConfiguredCommand conf, IClient rpc) => RPCSend(conf, rpc, false);
コード例 #6
0
 /// <nodoc />
 protected static int SyncRPCSend(ConfiguredCommand conf, IClient rpc) => RPCSend(conf, rpc, true);
コード例 #7
0
ファイル: ServicePipDaemon.cs プロジェクト: todun/BuildXL
        /// <summary>
        /// Creates anIPC client using the config from a ConfiguredCommand
        /// </summary>
        public static IClient CreateClient(ConfiguredCommand conf)
        {
            var daemonConfig = CreateDaemonConfig(conf);

            return(IpcProvider.GetClient(daemonConfig.Moniker, daemonConfig));
        }