// 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;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http.Features;
namespace Microsoft.AspNetCore.Hosting.Server
{
///
/// Represents an application.
///
/// The context associated with the application.
public interface IHttpApplication
{
///
/// Create a TContext given a collection of HTTP features.
///
/// A collection of HTTP features to be used for creating the TContext.
/// The created TContext.
TContext CreateContext(IFeatureCollection contextFeatures);
///
/// Asynchronously processes an TContext.
///
/// The TContext that the operation will process.
Task ProcessRequestAsync(TContext context);
///
/// Dispose a given TContext.
///
/// The TContext to be disposed.
/// The Exception thrown when processing did not complete successfully, otherwise null.
void DisposeContext(TContext context, Exception exception);
}
}