mirror of
https://github.com/actix/actix-web.git
synced 2024-12-30 12:00:38 +00:00
remove stream from WebsocketsContext::with_factory
This commit is contained in:
parent
cfa470db50
commit
1c3b32169e
1 changed files with 1 additions and 4 deletions
|
@ -110,11 +110,9 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create a new Websocket context
|
/// Create a new Websocket context
|
||||||
pub fn with_factory<F, P>(req: HttpRequest<S>, stream: WsStream<P>, f: F) -> Body
|
pub fn with_factory<F>(req: HttpRequest<S>, f: F) -> Body
|
||||||
where
|
where
|
||||||
F: FnOnce(&mut Self) -> A + 'static,
|
F: FnOnce(&mut Self) -> A + 'static,
|
||||||
A: StreamHandler<Message, ProtocolError>,
|
|
||||||
P: Stream<Item = Bytes, Error = PayloadError> + 'static,
|
|
||||||
{
|
{
|
||||||
let mb = Mailbox::default();
|
let mb = Mailbox::default();
|
||||||
let mut ctx = WebsocketContext {
|
let mut ctx = WebsocketContext {
|
||||||
|
@ -123,7 +121,6 @@ where
|
||||||
request: req,
|
request: req,
|
||||||
disconnected: false,
|
disconnected: false,
|
||||||
};
|
};
|
||||||
ctx.add_stream(stream);
|
|
||||||
|
|
||||||
let act = f(&mut ctx);
|
let act = f(&mut ctx);
|
||||||
Body::Actor(Box::new(WebsocketContextFut::new(ctx, act, mb)))
|
Body::Actor(Box::new(WebsocketContextFut::new(ctx, act, mb)))
|
||||||
|
|
Loading…
Reference in a new issue