1
0
mirror of https://github.com/actix/examples synced 2024-11-30 17:14:35 +01:00
examples/self-shutdown-route
2020-01-26 08:49:19 +09:00
..
src add self shutdown route example (#240) 2020-01-26 08:49:19 +09:00
Cargo.toml add self shutdown route example (#240) 2020-01-26 08:49:19 +09:00
README.md add self shutdown route example (#240) 2020-01-26 08:49:19 +09:00

self-shutdown-route

Demonstrates how to shutdown the web server using a route hosted by the server itself using channels.

This technique can be easily modified to support shutting down the server using other kinds of external events. Created in response to actix/actix-web#1315.

Usage

Running The Server

cargo run --bin self-shutdown-route

# Starting 8 workers
# Starting "actix-web-service-127.0.0.1:8080" service on 127.0.0.1:8080

Available Routes