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

no need for StreamHandler

This commit is contained in:
Nikolay Kim
2018-01-06 01:06:35 -08:00
parent 3ed9e872ad
commit 247c23c1ea
8 changed files with 31 additions and 55 deletions

View File

@ -151,9 +151,6 @@ impl<H: 'static> Actor for Worker<H> where H: HttpHandler + 'static {
}
}
impl<H> StreamHandler<Conn<net::TcpStream>> for Worker<H>
where H: HttpHandler + 'static {}
impl<H> Handler<Conn<net::TcpStream>> for Worker<H>
where H: HttpHandler + 'static,
{

View File

@ -23,8 +23,6 @@
//! }
//!
//! // Define Handler for ws::Message message
//! # impl StreamHandler<ws::Message> for Ws {}
//! #
//! impl Handler<ws::Message> for Ws {
//! type Result = ();
//!
@ -49,7 +47,7 @@ use http::{Method, StatusCode, header};
use bytes::BytesMut;
use futures::{Async, Poll, Stream};
use actix::{Actor, AsyncContext, ResponseType, StreamHandler};
use actix::{Actor, AsyncContext, ResponseType, Handler};
use payload::ReadAny;
use error::{Error, WsHandshakeError};
@ -86,7 +84,7 @@ impl ResponseType for Message {
/// Do websocket handshake and start actor
pub fn start<A, S>(mut req: HttpRequest<S>, actor: A) -> Result<HttpResponse, Error>
where A: Actor<Context=HttpContext<A, S>> + StreamHandler<Message>,
where A: Actor<Context=HttpContext<A, S>> + Handler<Message>,
S: 'static
{
let mut resp = handshake(&req)?;