引入redis服务,支持自动化单元测试
大石头 authored at 2022-03-31 22:56:30
715.00 B
X
using System;
using System.Threading;
using System.Threading.Tasks;

namespace NewLife.Agent
{
    /// <summary>主机承载的服务</summary>
    public interface IHostedService
    {
        String ServiceName { get; }
        //String DisplayName { get; }
        //String Description { get; }

        //Boolean Running { get; }

        /// <summary>开始</summary>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        Task StartAsync(CancellationToken cancellationToken);

        /// <summary>停止</summary>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        Task StopAsync(CancellationToken cancellationToken);
    }
}