feat: complete gRPC streaming channel — site host, docker config, docs, integration tests
Switch site host to WebApplicationBuilder with Kestrel HTTP/2 gRPC server, add GrpcPort/keepalive config, wire SiteStreamManager as ISiteStreamSubscriber, expose gRPC ports in docker-compose, add site seed script, update all 10 requirement docs + CLAUDE.md + README.md for the new dual-transport architecture.
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
using ScadaLink.Communication.Grpc;
|
||||
using ScadaLink.Commons.Interfaces.Repositories;
|
||||
using ScadaLink.SiteRuntime.Persistence;
|
||||
using ScadaLink.SiteRuntime.Repositories;
|
||||
using ScadaLink.SiteRuntime.Scripts;
|
||||
using ScadaLink.SiteRuntime.Streaming;
|
||||
|
||||
namespace ScadaLink.SiteRuntime;
|
||||
|
||||
@@ -40,6 +43,17 @@ public static class ServiceCollectionExtensions
|
||||
// WP-17: Shared script library
|
||||
services.AddSingleton<SharedScriptLibrary>();
|
||||
|
||||
// WP-23: Site stream manager — registered as singleton and exposed as ISiteStreamSubscriber
|
||||
// so the gRPC server can subscribe relay actors to instance events.
|
||||
// ActorSystem is injected later via Initialize() after AkkaHostedService starts.
|
||||
services.AddSingleton(sp =>
|
||||
{
|
||||
var options = sp.GetRequiredService<IOptions<SiteRuntimeOptions>>().Value;
|
||||
var logger = sp.GetRequiredService<ILogger<SiteStreamManager>>();
|
||||
return new SiteStreamManager(options, logger);
|
||||
});
|
||||
services.AddSingleton<ISiteStreamSubscriber>(sp => sp.GetRequiredService<SiteStreamManager>());
|
||||
|
||||
// Site-local repository implementations backed by SQLite
|
||||
services.AddScoped<IExternalSystemRepository, SiteExternalSystemRepository>();
|
||||
services.AddScoped<INotificationRepository, SiteNotificationRepository>();
|
||||
|
||||
Reference in New Issue
Block a user