1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-08-31 11:26:59 +02:00

update example to use actix 0.4

This commit is contained in:
Nikolay Kim
2018-01-05 14:01:19 -08:00
parent 5ff35f5b99
commit 5ae646332e
15 changed files with 150 additions and 243 deletions

View File

@@ -5,7 +5,6 @@ extern crate env_logger;
use actix::*;
use actix_web::*;
#[cfg(unix)]
use actix::actors::signal::{ProcessSignals, Subscribe};
struct MyWebSocket;
@@ -16,8 +15,10 @@ impl Actor for MyWebSocket {
impl StreamHandler<ws::Message> for MyWebSocket {}
impl Handler<ws::Message> for MyWebSocket {
fn handle(&mut self, _: ws::Message, _: &mut Self::Context) -> Response<Self, ws::Message> {
Self::empty()
type Result = ();
fn handle(&mut self, _: ws::Message, _: &mut Self::Context) {
{}
}
}
@@ -36,11 +37,8 @@ fn main() {
.start();
// Subscribe to unix signals
#[cfg(unix)]
{
let signals = actix::Arbiter::system_registry().get::<ProcessSignals>();
signals.send(Subscribe(addr.subscriber()));
}
let signals = actix::Arbiter::system_registry().get::<ProcessSignals>();
signals.send(Subscribe(addr.subscriber()));
println!("Started http server: 127.0.0.1:8080");
let _ = sys.run();