1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-06-25 18:09:22 +02:00

upgrade to actix 0.4

This commit is contained in:
Nikolay Kim
2018-01-05 13:30:21 -08:00
parent dea354d6d8
commit 5ff35f5b99
19 changed files with 75 additions and 90 deletions

View File

@ -195,13 +195,8 @@ fn main() {
}
```
It is possible to use unix signals on compatible OSs. "signal" feature needs to be enabled
in *Cargo.toml* for *actix-web* dependency.
```toml
[dependencies]
actix-web = { git = "https://github.com/actix/actix-web", features=["signal"] }
```
It is possible to use signals. *CTRL-C* is available on all OSs, other signals are
available on unix systems.
Then you can subscribe your server to unix signals. Http server handles three signals:

View File

@ -23,15 +23,15 @@ impl Actor for Ws {
/// Define Handler for ws::Message message
# impl StreamHandler<ws::Message> for Ws {}
impl Handler<ws::Message> for Ws {
fn handle(&mut self, msg: ws::Message, ctx: &mut HttpContext<Self>) -> Response<Self, ws::Message>
{
type Result=();
fn handle(&mut self, msg: ws::Message, ctx: &mut HttpContext<Self>) {
match msg {
ws::Message::Ping(msg) => ws::WsWriter::pong(ctx, &msg),
ws::Message::Text(text) => ws::WsWriter::text(ctx, &text),
ws::Message::Binary(bin) => ws::WsWriter::binary(ctx, bin),
_ => (),
}
Self::empty()
}
}