directory
Version:
v0.0.1
Opens a new window with list of versions in this module.
Published: Dec 18, 2023
License: MIT
Opens a new window with license information.
README
¶
Examples
Blog examples
These are the examples used in the blog post
Library Example
Creates a simples http.Server with:
/long-running-job
that sleeps for 10 seconds to demonstrate all active connections will finish before termination.
/hello
that will write hi
back :).
Running the example
$ go run examples/lib/http_example/main.go
You now have a HTTP server that has to endpoints:
/hello
which simply writes hi
back.
log-runing-job
which is simple time.Sleep
and then writes done
back.
Now when you send a HTTP request to /log-running-job
, and press ctrl+c
in server, the code will wait for all requests to finish and then terminates.
Click to show internal directories.
Click to hide internal directories.