Skip to content

Commit 5eea844

Browse files
committed
Updates readme
1 parent 6c014d6 commit 5eea844

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ For more information on how to use it refer to [examples](/examples/README.md) r
5757

5858
## Testing
5959

60-
```golang
61-
$ go run -v ./...
60+
```bash
61+
$ go test -v ./...
6262
```
6363

6464
## Contributing

examples/README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,16 @@ These are the examples used in the blog post
1717

1818
Creates a simples http.Server with:
1919
- `/long-running-job` that sleeps for 10 seconds to demonstrate all active connections will finish before termination.
20-
- `/hello` that will write `hi` back :).
20+
- `/hello` that will write `hi` back :).
21+
22+
### Running the example
23+
24+
```bash
25+
$ go run examples/lib/http_example/main.go
26+
```
27+
28+
You now have a HTTP server that has to endpoints:
29+
1. `/hello` which simply writes `hi` back.
30+
2. `log-runing-job` which is simple `time.Sleep` and then writes `done` back.
31+
32+
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.

examples/lib/http_example/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func main() {
2020
})
2121

2222
// create a simple http server
23-
exampleHTTPServer := NewExampleHTTPServer(":8080")
23+
exampleHTTPServer := NewExampleHTTPServer(":8000")
2424

2525
// add start and close operations to grace instance
2626
grace.GoWithContext(exampleHTTPServer.start)

0 commit comments

Comments
 (0)