fiber/middleware/timeout
RW bc37f209bf
refactor(timeout): unify and enhance timeout middleware (#3275)
* feat(timeout): unify and enhance timeout middleware

- Combine classic context-based timeout with a Goroutine + channel approach
- Support custom error list without additional parameters
- Return fiber.ErrRequestTimeout for timeouts or listed errors

* feat(timeout): unify and enhance timeout middleware

- Combine classic context-based timeout with a Goroutine + channel approach
- Support custom error list without additional parameters
- Return fiber.ErrRequestTimeout for timeouts or listed errors

* refactor(timeout): remove goroutine-based logic and improve documentation

- Switch to a synchronous approach to avoid data races with fasthttp context
- Enhance error handling for deadline and custom errors
- Update comments for clarity and maintainability

* refactor(timeout): add more test cases and handle zero duration case

* refactor(timeout): add more test cases and handle zero duration case

* refactor(timeout): add more test cases and handle zero duration case

---------

Co-authored-by: Juan Calderon-Perez <835733+gaby@users.noreply.github.com>
2025-01-08 08:19:20 +01:00
..
timeout.go refactor(timeout): unify and enhance timeout middleware (#3275) 2025-01-08 08:19:20 +01:00
timeout_test.go refactor(timeout): unify and enhance timeout middleware (#3275) 2025-01-08 08:19:20 +01:00