I have a scenario as such.
A base class which modules are derived from.
Each module has it's own signalr hubs.
I want to host all modules in a single host, separated by module name.
Some modules will share hub names.
namespace domain.com.base
{
public class BaseClass
{
public string ApplicationName;
}
}
namespace domain.com.billing
{
public class Billing : BaseClass
{
ApplicationName = "Billing";
}
public class NotificationHub : Hub
{
public void Credit(decimal amount)
{
Clients.All.Notify(amount);
}
}
}
namespace domain.com.reporting
{
public class Reporting : BaseClass
{
ApplicationName = "Reporting";
}
public class ReportingHub : Hub
{
public Report GetReport(int Id)
{
return ReportModule.RetrieveReport(Id);
}
}
}
In OWIN.Startup.Configuration(IAppBuilder) is it possible to do something like such
namespace domain.com.external_access
{
public void Configuration(IAppBuilder app)
{
var asmList = GlobalResolver.Applications();
foreach(var asm in asmList)
{
app.MapSignalR(asm.ApplicationName,false);
}
}
}
Effectively giving you something like so...
http://domain.com.external_access/Reporting/hubs http://domain.com.external_access/Billing/hubs
app.MapSignalR("/Reporting/signalr"); app.MapSignalR("/Billing/signalr");...
?