Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Shutdown to support graceful quit of HTTP Server #618

Merged
merged 3 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions contracts/route/route.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package route

import (
"context"
"net/http"

contractshttp "github.com/goravel/framework/contracts/http"
Expand All @@ -22,6 +23,8 @@ type Route interface {
RunTLSWithCert(host, certFile, keyFile string) error
// ServeHTTP serves HTTP requests.
ServeHTTP(writer http.ResponseWriter, request *http.Request)
// Shutdown gracefully shuts down the serve.If the provided context expires before the shutdown is complete, Shutdown returns the context's error.
Shutdown(ctx context.Context) error
}

type Router interface {
Expand Down
48 changes: 48 additions & 0 deletions mocks/route/Route.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading