private static int OnParse(GlobalOptions globals, object opts) { var parsedOptions = SmiCliInit.Verify <TriggerUpdatesCliOptions>(opts); ITriggerUpdatesSource source = parsedOptions switch { TriggerUpdatesFromMapperOptions o => new MapperSource(globals, o), TriggerUpdatesFromMongoOptions o => new MongoSource(globals, o), _ => throw new NotImplementedException($"No case for '{parsedOptions.GetType()}'") }; var bootstrapper = new MicroserviceHostBootstrapper(() => new TriggerUpdatesHost(globals, source)); int ret = bootstrapper.Main(); return(ret); } }
public TriggerUpdatesHost(GlobalOptions options, ITriggerUpdatesSource source, IRabbitMqAdapter rabbitMqAdapter = null) : base(options, rabbitMqAdapter) { this._source = source; _producer = RabbitMqAdapter.SetupProducer(options.TriggerUpdatesOptions, isBatch: false); }