Beispiel #1
0
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddControllers();
            services.AddHttpClient();

            services.AddSingleton(_ => ActorSystem.Create("dataviewer"));
            services.AddSingleton(provider =>
            {
                var actorSystem   = provider.GetRequiredService <ActorSystem>();
                var materializer  = actorSystem.Materializer(namePrefix: "httpMaterializer");
                var clientFactory = provider.GetService <IHttpClientFactory>();
                var actor         = actorSystem
                                    .ActorOf(
                    HttpDownloader.GetProp(materializer, clientFactory),
                    "httpDownloaderActor");

                return(actor);
            });
        }