mirror of
https://github.com/actix/actix-web.git
synced 2024-12-19 14:49:01 +00:00
fix guide example
This commit is contained in:
parent
0d21c2da22
commit
5df5cc7374
2 changed files with 10 additions and 4 deletions
|
@ -28,7 +28,13 @@ before_script:
|
|||
- export PATH=$PATH:~/.cargo/bin
|
||||
|
||||
script:
|
||||
- USE_SKEPTIC=1 cargo test --features=alpn
|
||||
- |
|
||||
if [[ "$TRAVIS_RUST_VERSION" == "nightly-2017-12-21" ]]; then
|
||||
USE_SKEPTIC=1 cargo test --features=alpn
|
||||
else
|
||||
cargo test --features=alpn
|
||||
fi
|
||||
|
||||
- |
|
||||
if [[ "$TRAVIS_RUST_VERSION" == "beta" ]]; then
|
||||
cd examples/diesel && cargo check && cd ../..
|
||||
|
|
|
@ -21,8 +21,8 @@ impl Actor for Ws {
|
|||
}
|
||||
|
||||
/// Define Handler for ws::Message message
|
||||
# impl StreamHandler<ws::Message> for WsRoute {}
|
||||
impl Handler<ws::Message> for WsRoute {
|
||||
# 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>
|
||||
{
|
||||
match msg {
|
||||
|
@ -37,7 +37,7 @@ impl Handler<ws::Message> for WsRoute {
|
|||
|
||||
fn main() {
|
||||
Application::new()
|
||||
.resource("/ws/", |r| r.f(|req| ws::start(req, WS)) // <- register websocket route
|
||||
.resource("/ws/", |r| r.f(|req| ws::start(req, Ws))) // <- register websocket route
|
||||
.finish();
|
||||
}
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue