mirror of
https://github.com/actix/actix-web.git
synced 2024-12-20 23:26:44 +00:00
do not use try_trait in main
This commit is contained in:
parent
31500fffcd
commit
178d2e846d
1 changed files with 10 additions and 4 deletions
|
@ -61,11 +61,17 @@ impl Route for MyWS {
|
|||
|
||||
fn request(req: HttpRequest, payload: Payload, ctx: &mut HttpContext<Self>) -> Reply<Self>
|
||||
{
|
||||
let resp = ws::handshake(&req)?;
|
||||
match ws::handshake(&req) {
|
||||
Ok(resp) => {
|
||||
ctx.start(resp);
|
||||
ctx.add_stream(ws::WsStream::new(payload));
|
||||
Reply::stream(MyWS{})
|
||||
}
|
||||
Err(err) => {
|
||||
Reply::reply(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ResponseType<ws::Message> for MyWS {
|
||||
|
|
Loading…
Reference in a new issue