Ejemplo n.º 1
0
        public async Task <Task> StartAsync(string[] args)
        {
            var brokerArgs = BrokerArguments.Parse(args);

            _brokerRunner = new BrokerRunner(brokerArgs.MetadataDir);
            if (_stoped == 1)
            {
                return(Task.FromResult(0));
            }
            await _brokerRunner.StartAsync().ConfigureAwait(false);

            Log.Debug("Broker process started");
            return(_brokerRunner.Completion);
        }
Ejemplo n.º 2
0
        public async Task <int> RunAsync(string[] args)
        {
            try
            {
                var metadataDir = args.Length > 0 ? args[0] : Directory.GetCurrentDirectory();
                _brokerRunner = new BrokerRunner(metadataDir);
                if (_stoped == 1)
                {
                    return(0);
                }
                await _brokerRunner.StartAsync().ConfigureAwait(false);

                await _brokerRunner.Completion.ConfigureAwait(false);

                Log.Debug("Broker process completed");
                return(0);
            }
            catch (Exception ex)
            {
                Log.Error(ex, "Terminated with exception");
                return(1);
            }
        }