mirror of
https://github.com/actix/actix-extras.git
synced 2024-12-01 02:44:37 +01:00
always start actors
This commit is contained in:
parent
5368ce823e
commit
5baf15822a
@ -188,7 +188,7 @@ impl<A, S> ActorHttpContext for HttpContext<A, S> where A: Actor<Context=Self>,
|
||||
mem::transmute(self as &mut HttpContext<A, S>)
|
||||
};
|
||||
|
||||
if self.inner.alive() {
|
||||
if self.inner.started() && self.inner.alive() {
|
||||
match self.inner.poll(ctx) {
|
||||
Ok(Async::NotReady) | Ok(Async::Ready(())) => (),
|
||||
Err(_) => return Err(ErrorInternalServerError("error").into()),
|
||||
|
@ -481,6 +481,7 @@ impl<S: 'static, H> ProcessResponse<S, H> {
|
||||
}
|
||||
}
|
||||
|
||||
// always poll stream or actor for the first time
|
||||
match self.resp.replace_body(Body::Empty) {
|
||||
Body::Streaming(stream) => {
|
||||
self.iostate = IOState::Payload(stream);
|
||||
|
@ -204,7 +204,7 @@ impl<A, S> ActorHttpContext for WebsocketContext<A, S> where A: Actor<Context=Se
|
||||
mem::transmute(self as &mut WebsocketContext<A, S>)
|
||||
};
|
||||
|
||||
if self.inner.alive() && self.inner.poll(ctx).is_err() {
|
||||
if self.inner.started() && self.inner.alive() && self.inner.poll(ctx).is_err() {
|
||||
return Err(ErrorInternalServerError("error").into())
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user