// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Threading;
using System.Threading.Tasks;
namespace Microsoft.Extensions.Hosting
{
public interface IHostLifetime
{
///
/// Called at the start of which will wait until it's complete before
/// continuing. This can be used to delay startup until signaled by an external event.
///
Task WaitForStartAsync(CancellationToken cancellationToken);
///
/// Called from to indicate that the host as stopped and clean up resources.
///
/// Used to indicate when stop should no longer be graceful.
///
Task StopAsync(CancellationToken cancellationToken);
}
}