发布2020.0601
大石头 编写于 2020-05-31 10:19:29
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);
    }
}