Beispiel #1
0
        public static void AddActorSystem(this IServiceCollection services)
        {
            string host = EnvSettings.Instance().AkkaAddress;

            var huconConfig = Path.Combine(Directory.GetCurrentDirectory(), EnvSettings.Instance().HuconFileName);
            var config      = HoconLoader.FromFile(huconConfig);

            var actorSystem         = ActorSystem.Create(EnvSettings.Instance().ActorSystem, config);
            var memberActorProvider = new MemberActorProvider(actorSystem, host);
            //var backLogsActorProvider = new BackLogsActorProvider(actorSystem, host);
            //var jobsActorProvider = new JobsActorProvider(actorSystem, host);
            var commonStocksProvider     = new CommonStocksProvider(actorSystem, host);
            var eodStocksProvider        = new EodStocksProvider(actorSystem, host);
            var commonStockRouteProvider = new CommonStockRouteProvider(actorSystem, host);

            services.AddSingleton(typeof(ActorSystem), actorSystem);


            services.AddSingleton <MemberActorProvider>(_ => memberActorProvider);
            //services.AddSingleton<BackLogsActorProvider>(_ => backLogsActorProvider);
            //services.AddSingleton<JobsActorProvider>(_ => jobsActorProvider);
            services.AddSingleton <CommonStocksProvider>(_ => commonStocksProvider);
            services.AddSingleton <EodStocksProvider>(_ => eodStocksProvider);
            services.AddSingleton <CommonStockRouteProvider>(_ => commonStockRouteProvider);

            services.AddMemberServices();
            //services.AddJobServices();
            //services.AddBackLogServices();
            services.AddCommonStockServices();
        }
Beispiel #2
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;
            }
        }
Beispiel #3
0
 public AddDiscussion(CommonStockRouteProvider provider, IStockDiscussionPublisher publisher, ILogger <GetCommonStocks> logger)
 {
     this.Logger = logger;
     this.CommonStockRouteActor = provider.Get();
     this.Pubisher = publisher;
 }
Beispiel #4
0
 public GetStockInfo(CommonStockRouteProvider provider, ILogger <GetCommonStocks> logger)
 {
     this.Logger = logger;
     this.CommonStockRouteActor = provider.Get();
 }
Beispiel #5
0
 public GetDiscussion(CommonStockRouteProvider provider, ILogger <GetDiscussion> logger)
 {
     this.Logger = logger;
     this.CommonStockRouteActor = provider.Get();
 }