namespace ZB.MOM.WW.MxGateway.Server.Sessions;
/// Service collection extensions for session management.
public static class SessionServiceCollectionExtensions
{
/// Registers gateway session registry, manager, and factory services.
/// Service collection to register services in.
/// The service collection for chaining.
public static IServiceCollection AddGatewaySessions(this IServiceCollection services)
{
// Lifetime consistent with IGalaxyHierarchyCache (singleton); the normalizer reads the
// cache's current snapshot per call, so it holds no per-session or per-request state.
services.AddSingleton();
services.AddSingleton();
services.AddSingleton();
services.AddSingleton();
services.AddHostedService();
services.AddHostedService();
return services;
}
}