1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-28 01:32:57 +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
- stable
- beta
- nightly-2017-12-21
- nightly
sudo: required
dist: trusty
@ -58,7 +58,7 @@ script:
# Upload docs
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 &&
echo "<meta http-equiv=refresh content=0;url=os_balloon/index.html>" > target/doc/index.html &&
cargo install mdbook &&

View File

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