Ext IExService

pull/1/head
Ogoun 6 years ago
parent be45ffc506
commit fc03d49fb4

@ -10,9 +10,10 @@ namespace ZeroLevel.Services.Applications
public string Group { get; private set; } public string Group { get; private set; }
public string Type { get; private set; } public string Type { get; private set; }
protected readonly Exchange _exchange;
protected readonly IConfiguration _config; protected readonly IConfiguration _config;
protected Exchange Exchange { get; }
protected BaseWindowsExService(IConfiguration configuration = null) protected BaseWindowsExService(IConfiguration configuration = null)
: base() : base()
{ {
@ -25,7 +26,7 @@ namespace ZeroLevel.Services.Applications
var discovery = _config.First("discovery"); var discovery = _config.First("discovery");
_exchange = new Exchange(new DiscoveryClient(discovery)); Exchange = new Exchange(new DiscoveryClient(discovery));
} }
private IExService _self_service = null; private IExService _self_service = null;
@ -40,7 +41,7 @@ namespace ZeroLevel.Services.Applications
{ {
if (_self_service == null) if (_self_service == null)
{ {
_self_service = _exchange.RegisterService(this); _self_service = Exchange.RegisterService(this);
} }
} }
} }
@ -101,7 +102,7 @@ namespace ZeroLevel.Services.Applications
public override void DisposeResources() public override void DisposeResources()
{ {
this._exchange.Dispose(); this.Exchange.Dispose();
} }
} }
} }

@ -7,6 +7,8 @@ namespace ZeroLevel.Network
: IDisposable : IDisposable
{ {
IPEndPoint Endpoint { get; } IPEndPoint Endpoint { get; }
event Action<IZBackward> OnConnect;
event Action<IZBackward> OnDisconnect;
void RegisterInbox<T>(string inbox, Action<T, long, IZBackward> handler); void RegisterInbox<T>(string inbox, Action<T, long, IZBackward> handler);

Loading…
Cancel
Save

Powered by TurnKey Linux.