Documentation
¶
Overview ¶
Deferred-init example.
Demonstrates serving /healthz immediately while long-running bootstrap work (warmCaches) runs in the background. Application routes return 503 until bootstrap and the OnReady hook both succeed, then the server flips to ready.
Run it:
go run examples/deferred-init/main.go
Then in another shell:
curl -i http://localhost:8080/healthz # 200 immediately curl -i http://localhost:8080/api/users # 503 until ready (~3s), then 200
Click to show internal directories.
Click to hide internal directories.