using System.Net;
using System.Threading.Tasks;
namespace WelsonJS.Launcher
{
    /// 
    /// Defines a contract for resource tools that can handle specific HTTP requests.
    /// 
    public interface IResourceTool
    {
        /// 
        /// Determines whether this tool can handle the specified path.
        /// 
        /// The request path to check.
        /// True if this tool can handle the request; otherwise, false.
        bool CanHandle(string path);
        /// 
        /// Asynchronously processes the HTTP request for the specified path.
        /// 
        /// The HTTP listener context containing request and response objects.
        /// The request path to handle.
        /// A task representing the asynchronous operation.
        Task HandleAsync(HttpListenerContext context, string path);
    }
}