IHTTPRequestHandler.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #if !UNITY_WEBGL || UNITY_EDITOR
  2. using System;
  3. using Best.HTTP.Shared;
  4. using Best.HTTP.Shared.Logger;
  5. namespace Best.HTTP.Hosts.Connections
  6. {
  7. /// <summary>
  8. /// Common interface for implementations that will coordinate request processing inside a connection.
  9. /// </summary>
  10. public interface IHTTPRequestHandler : IDisposable
  11. {
  12. KeepAliveHeader KeepAlive { get; }
  13. bool CanProcessMultiple { get; }
  14. /// <summary>
  15. /// Number of assigned requests to process.
  16. /// </summary>
  17. int AssignedRequests { get; }
  18. /// <summary>
  19. /// Maximum number of assignable requests.
  20. /// </summary>
  21. int MaxAssignedRequests { get; }
  22. ShutdownTypes ShutdownType { get; }
  23. LoggingContext Context { get; }
  24. void Process(HTTPRequest request);
  25. void RunHandler();
  26. /// <summary>
  27. /// An immediate shutdown request that called only on application closure.
  28. /// </summary>
  29. void Shutdown(ShutdownTypes type);
  30. }
  31. }
  32. #endif