1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-24 07:53:00 +01:00

update example

This commit is contained in:
Nikolay Kim 2018-01-02 19:43:59 -08:00
parent 3a59344ffb
commit 7af3b3f956
2 changed files with 8 additions and 7 deletions

View File

@ -4,7 +4,7 @@ rust:
- 1.20.0 - 1.20.0
- stable - stable
- beta - beta
- nightly-2017-12-21 - nightly
sudo: required sudo: required
dist: trusty dist: trusty
@ -58,7 +58,7 @@ script:
# Upload docs # Upload docs
after_success: after_success:
- | - |
if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_PULL_REQUEST" = "false" && "$TRAVIS_BRANCH" == "master" && "$TRAVIS_RUST_VERSION" == "nightly-2017-12-21" ]]; then if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_PULL_REQUEST" = "false" && "$TRAVIS_BRANCH" == "master" && "$TRAVIS_RUST_VERSION" == "nightly" ]]; then
cargo doc --features alpn --no-deps && cargo doc --features alpn --no-deps &&
echo "<meta http-equiv=refresh content=0;url=os_balloon/index.html>" > target/doc/index.html && echo "<meta http-equiv=refresh content=0;url=os_balloon/index.html>" > target/doc/index.html &&
cargo install mdbook && cargo install mdbook &&

View File

@ -19,7 +19,8 @@ extern crate env_logger;
use actix::*; use actix::*;
use actix_web::*; use actix_web::*;
use actix::prelude::*; use actix::prelude::*;
#[cfg(target_os = "linux")] use actix::actors::signal::{ProcessSignals, Subscribe}; #[cfg(unix)]
use actix::actors::signal::{ProcessSignals, Subscribe};
use diesel::prelude::*; use diesel::prelude::*;
use futures::future::Future; use futures::future::Future;
@ -70,10 +71,10 @@ fn main() {
.bind("127.0.0.1:8080").unwrap() .bind("127.0.0.1:8080").unwrap()
.start(); .start();
if cfg!(target_os = "linux") { // Subscribe to unix signals // Subscribe to unix signals
let signals = Arbiter::system_registry().get::<ProcessSignals>(); #[cfg(unix)]
signals.send(Subscribe(_addr.subscriber())); { let signals = Arbiter::system_registry().get::<ProcessSignals>();
} signals.send(Subscribe(_addr.subscriber())); }
println!("Started http server: 127.0.0.1:8080"); println!("Started http server: 127.0.0.1:8080");
let _ = sys.run(); let _ = sys.run();