Пример #1
0
        public void Start()
        {
            try
            {
                var huconConfig = Path.Combine(Directory.GetCurrentDirectory(), EnvSettings.Instance().HuconFileName);
                var config      = HoconLoader.FromFile(huconConfig);
                ActorSystemInstance = ActorSystem.Create(EnvSettings.Instance().ActorSystem, config);

                IMemberRepository          memberRepository          = new MockMemberRepository();
                ICommonStockRepository     commonStockRepository     = new MockCommonStockRepository();
                ICommonStockInfoRepository commonStockInfoRepository = new MockCommonStockInfoRepository();
                IEodRepository             eodRepository             = new MockEodRepository();

                //IBatchPublisher batchPublisher = new BatchPublisher(new Uri(EnvSettings.Instance().BatchUrl));

                var memberController = MemberActorProvider.CreateInstance(ActorSystemInstance, memberRepository);
                //var jobsActorProvider = JobsActorProvider.CreateInstance(ActorSystemInstance, batchPublisher);
                //var backLogsActor = BackLogsActorProvider.CreateInstance(ActorSystemInstance, new JobsActorProvider(ActorSystemInstance, EnvSettings.Instance().AkkaAddress));
                var commonStocksActor     = CommonStocksProvider.CreateInstance(ActorSystemInstance, commonStockRepository, commonStockInfoRepository);
                var eodStocksActor        = EodStocksProvider.CreateInstance(ActorSystemInstance, eodRepository);
                var commonStockRouteActor = CommonStockRouteProvider.CreateInstance(ActorSystemInstance, commonStocksActor, eodStocksActor);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #2
0
        public static IWebHost BuildWebHost(string[] args) =>

        WebHost.CreateDefaultBuilder(args)
        .UseKestrel(options => {
            options.Listen(EnvSettings.Instance().IP, EnvSettings.Instance().Port);
        }).ConfigureAppConfiguration((hostingContext, config) =>
        {
            var env = hostingContext.HostingEnvironment;
            config.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
            .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true);
            config.AddEnvironmentVariables();
        }).ConfigureLogging((hostingContext, logging) =>
        {
            Log.Logger = new LoggerConfiguration()
                         .MinimumLevel.Verbose()
                         .WriteTo.LiterateConsole()
                         .WriteTo.RollingFile("logs/log-{Date}.txt")
                         .CreateLogger();
        })
        .UseStartup <Startup>()
        .Build();