JavaRush
AI Academy
new
Promotion
Learning
Courses
Tasks
Quizzes
Games
Help
Schedule of nudges
Internship
Community
Users
Forum
Chat
Articles
Activities
Reviews
Subscriptions
Light theme

Lectures

  • Reviews
  • About us
  • CS50
Start
Start learning
Start learning
  • My progress
  • Courses
  • Quest map
  • Lectures
  • Stopping an HTTP server without losing requests

    Go SELF
    63 level,0 lecture
    We break down how to implement graceful shutdown for an HTTP server in Go: turn OS signals into context cancellation via signal.NotifyContext, correctly wait for shutdown via <- ctx . Done() without polling loops, run ListenAndServe() in a goroutine, and don’t treat http.ErrServerClosed as a crash. At the end, there’s a set of common mistakes that most often break a “clean shutdown”.
    Open
  • Server.Shutdown(ctx) and the shutdown timeout

    Go SELF
    63 level,1 lecture
    We break down how graceful HTTP server shutdown works via (*http.Server).Shutdown(ctx), why a context without a deadline is dangerous, and which “canonical” template to use: context.WithTimeout, defer cancel (), proper logging of context.DeadlineExceeded, and filtering http.ErrServerClosed. We will also show graceful shutdown in main () via signal.NotifyContext.
    Open
  • HTTP server timeouts

    Go SELF
    63 level,2 lecture
    We’ll break down why an HTTP server needs timeouts and how they “cut off” different stages of a connection’s lifecycle: reading headers ( ReadHeaderTimeout), reading the entire request ( ReadTimeout), writing the response ( WriteTimeout), and keep-alive idling ( IdleTimeout). Using examples with net/http and http.Server, we’ll assemble the configuration in one place and discuss common configuration mistakes.
    Open
  • Canceling a request via r . Context () and handling it correctly

    Go SELF
    63 level,3 lecture
    We break down how to correctly react to HTTP request cancellation in net/http via r . Context (): why you should check ctx . Err (), how to “carry” context.Context through layers, how to do “long” work in chunks and set internal timeouts via context . WithTimeout (), and which typical mistakes lead to pointless load on the server.
    Open
  • Stopping background tasks on shutdown

    Go SELF
    63 level,4 lecture
    We break down how to correctly stop background goroutines when shutting down an HTTP server: why you need an application-level context ( appCtx), why r.Context() is almost never suitable for “long-running background” work, how to tie cancellation to srv.RegisterOnShutdown, and how to wait for background work to finish via the done channel so the process exits predictably and without hangs.
    Open
Learn
  • Registration
  • Java course
  • Help with tasks
  • Pricing
  • Game projects
Community
  • Users
  • Articles
  • Forum
  • Chat
  • Activities
Company
  • About us
  • Contacts
  • Reviews
  • FAQ
  • Support
JavaRushJavaRush — is an interactive online course for learning Java programming from scratch. It contains 1200 practical tasks with one-click solution checking, the necessary minimum of theory on Java basics, and motivating features that help you complete the course: games, quizzes, interesting projects and articles on effective learning and the career of a Java developer.
Follow us
Язык интерфейса
Русский
English
Українська
"Programmers are not born" © 2026 JavaRush
MastercardVisa
"Programmers are not born" © 2026 JavaRush