mirror of
https://github.com/fafhrd91/actix-web
synced 2025-08-31 17:07:01 +02:00
* fix force_close
* shutdown io before exit * fix response creation with body from pool
This commit is contained in:
@@ -14,7 +14,6 @@ use actix::dev::{AsyncContextApi, ActorAddressCell, ActorItemsCell, ActorWaitCel
|
||||
use body::{Body, Binary};
|
||||
use error::{Error, Result};
|
||||
use httprequest::HttpRequest;
|
||||
use httpresponse::HttpResponse;
|
||||
|
||||
|
||||
pub trait ActorHttpContext: 'static {
|
||||
@@ -124,16 +123,6 @@ impl<A, S: 'static> HttpContext<A, S> where A: Actor<Context=Self> {
|
||||
self.act = Some(actor);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_actor(mut self, actor: A, mut resp: HttpResponse) -> Result<HttpResponse> {
|
||||
if self.act.is_some() {
|
||||
panic!("Actor is set already");
|
||||
}
|
||||
self.act = Some(actor);
|
||||
|
||||
resp.replace_body(Body::Actor(Box::new(self)));
|
||||
Ok(resp)
|
||||
}
|
||||
}
|
||||
|
||||
impl<A, S> HttpContext<A, S> where A: Actor<Context=Self> {
|
||||
|
Reference in New Issue
Block a user