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:
@@ -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();
|
||||
|
Reference in New Issue
Block a user