feat: wire Inbound API Route.To().Call() to site instance scripts and add Roslyn compilation
Completes the Inbound API → site script call chain by adding RouteToCallRequest handlers in SiteCommunicationActor and DeploymentManagerActor. Also replaces the placeholder dispatch table in InboundScriptExecutor with Roslyn compilation of API method scripts at startup, enabling user-defined inbound API methods to call instance scripts across the cluster.
This commit is contained in:
@@ -129,6 +129,19 @@ try
|
||||
app.MapStaticAssets();
|
||||
app.MapCentralUI<ScadaLink.Host.Components.App>();
|
||||
app.MapInboundAPI();
|
||||
|
||||
// Compile and register all Inbound API method scripts at startup
|
||||
using (var scope = app.Services.CreateScope())
|
||||
{
|
||||
var apiRepo = scope.ServiceProvider.GetRequiredService<ScadaLink.Commons.Interfaces.Repositories.IInboundApiRepository>();
|
||||
var executor = app.Services.GetRequiredService<ScadaLink.InboundAPI.InboundScriptExecutor>();
|
||||
var methods = await apiRepo.GetAllApiMethodsAsync();
|
||||
foreach (var method in methods)
|
||||
{
|
||||
executor.CompileAndRegister(method);
|
||||
}
|
||||
}
|
||||
|
||||
await app.RunAsync();
|
||||
}
|
||||
else if (nodeRole.Equals("Site", StringComparison.OrdinalIgnoreCase))
|
||||
|
||||
Reference in New Issue
Block a user