You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Zero/ZeroLevel.Discovery/DiscoveryService.cs

31 lines
888 B

5 years ago
using ZeroLevel.Models;
using ZeroLevel.Network;
using ZeroLevel.Services.Applications;
namespace ZeroLevel.Discovery
{
public sealed class DiscoveryService
: BaseZeroService
{
5 years ago
private IRouter _exInbox;
public DiscoveryService()
: base("Discovery")
{
}
protected override void StartAction()
{
var routeTable = new RouteTable();
Injector.Default.Register<RouteTable>(routeTable);
5 years ago
var servicePort = Configuration.Default.First<int>("port");
_exInbox = UseHost(servicePort);
_exInbox.RegisterInbox("services", (_) => routeTable.Get());
5 years ago
_exInbox.RegisterInbox<ZeroServiceInfo, InvokeResult>("register", (client, info) => routeTable.Append(info, client));
}
protected override void StopAction()
{
}
}
}

Powered by TurnKey Linux.