mirror of
https://github.com/dotnetcore/AgileConfig.git
synced 2026-10-25 17:57:48 +08:00
34 lines
942 B
C#
34 lines
942 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using AgileConfig.Server.IService;
|
|
using Microsoft.Extensions.Hosting;
|
|
|
|
namespace AgileConfig.Server.Apisite
|
|
{
|
|
public class InitService: IHostedService
|
|
{
|
|
private IRemoteServerNodeProxy _remoteServerNodeProxy;
|
|
private IEventRegister _eventRegister;
|
|
public InitService(IRemoteServerNodeProxy proxy, IEventRegister eventRegister)
|
|
{
|
|
_remoteServerNodeProxy = proxy;
|
|
_eventRegister = eventRegister;
|
|
}
|
|
|
|
public Task StartAsync(CancellationToken cancellationToken)
|
|
{
|
|
_remoteServerNodeProxy.TestEchoAsync();
|
|
_eventRegister.Init();
|
|
return Task.CompletedTask;
|
|
}
|
|
|
|
public Task StopAsync(CancellationToken cancellationToken)
|
|
{
|
|
return Task.CompletedTask;
|
|
}
|
|
}
|
|
}
|