Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
src Re-exporting all of plain May 2, 2019
Cargo.toml Update nix requirement from 0.14 to 0.15 Aug 12, 2019
README.md Updating example's README Apr 3, 2019

README.md

Hello World

Example of how to implement graceful shutdown for the web service.

Running

From the examples/hello_world_until directory:

Terminal 1:
$ cargo run
   Compiling hello_world (file:///.../examples/hello_world)
    Finished dev [unoptimized + debuginfo] target(s) in 4.26 secs
     Running `../hello_world`
  Listening for requests at http://127.0.0.1:7878
  Press Ctrl+C to exit

Terminal 2:
$ curl -v http://127.0.0.1:7878/
*  Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 7878 (#0)
> GET / HTTP/1.1
> Host: 127.0.0.1:7878
> User-Agent: curl/7.54.1
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Length: 12
< Content-Type: text/plain
< X-Request-ID: 88ec311c-fc77-4d2e-b302-b1ba38718d96
< X-Frame-Options: DENY
< X-XSS-Protection: 1; mode=block
< X-Content-Type-Options: nosniff
< X-Runtime-Microseconds: 51
< Date: Fri, 05 Jan 2018 06:25:00 GMT
<
* Connection #0 to host 127.0.0.1 left intact
Hello World!%

Terminal 1 again:
<press Ctrl+C>
  Ctrl+C pressed
  Shutting down gracefully

License

Licensed under your option of:

Community

The following policies guide participation in our project and our community:

You can’t perform that action at this time.