1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-09-02 09:36:39 +02:00

fix examples

This commit is contained in:
Nikolay Kim
2018-08-23 13:39:13 -07:00
parent d97f78afbe
commit 1261ecbce0
3 changed files with 37 additions and 30 deletions

View File

@@ -43,13 +43,17 @@ fn main() {
.unwrap();
let num = Arc::new(AtomicUsize::new(0));
let openssl = ssl::OpensslService::new(builder);
// configure service
let srv = ssl::OpensslService::new(builder).and_then((service, move || {
Ok::<_, io::Error>(ServiceState { num: num.clone() })
}));
// server start mutiple workers, it runs supplied `Fn` in each worker.
Server::default().bind("0.0.0.0:8443", move || {
let num = num.clone();
Server::default().bind("0.0.0.0:8443", srv).unwrap().start();
// configure service
openssl.clone().and_then((service, move || {
Ok::<_, io::Error>(ServiceState { num: num.clone() })
}))
}).unwrap().start();
sys.run();
}