Skip to content

Commit 871ca5e

Browse files
committed
stop claiming actor support
1 parent ceace26 commit 871ca5e

File tree

4 files changed

+10
-81
lines changed

4 files changed

+10
-81
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
* SSL support using OpenSSL or Rustls
3333
* Middlewares ([Logger, Session, CORS, etc](https://actix.rs/docs/middleware/))
3434
* Includes an async [HTTP client](https://actix.rs/actix-web/actix_web/client/index.html)
35-
* Supports [Actix actor framework](https://github.com/actix/actix)
3635
* Runs on stable Rust 1.46+
3736

3837
## Documentation

actix-http/src/h1/dispatcher.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ where
356356
this.state.set(State::ServiceCall(task));
357357
};
358358
}
359+
359360
// handle error message.
360361
Some(DispatcherMessage::Error(res)) => {
361362
// send_response would update InnerDispatcher state to SendPayload or
@@ -364,10 +365,12 @@ where
364365
self.as_mut()
365366
.send_response(res, ResponseBody::Other(Body::Empty))?;
366367
}
368+
367369
// return with upgrade request and poll it exclusively.
368370
Some(DispatcherMessage::Upgrade(req)) => {
369371
return Ok(PollResponse::Upgrade(req));
370372
}
373+
371374
// all messages are dealt with.
372375
None => return Ok(PollResponse::DoNothing),
373376
},
@@ -377,12 +380,14 @@ where
377380
let (res, body) = res.into().replace_body(());
378381
self.as_mut().send_response(res, body)?;
379382
}
383+
380384
// send service call error as response
381385
Poll::Ready(Err(e)) => {
382386
let res: Response = e.into().into();
383387
let (res, body) = res.replace_body(());
384388
self.as_mut().send_response(res, body.into_body())?;
385389
}
390+
386391
// service call pending and could be waiting for more chunk messages.
387392
// (pipeline message limit and/or payload can_read limit)
388393
Poll::Pending => {
@@ -394,6 +399,7 @@ where
394399
// otherwise keep loop.
395400
}
396401
},
402+
397403
StateProj::SendPayload(mut stream) => {
398404
// keep populate writer buffer until buffer size limit hit,
399405
// get blocked or finished.
@@ -405,6 +411,7 @@ where
405411
&mut this.write_buf,
406412
)?;
407413
}
414+
408415
Poll::Ready(None) => {
409416
this.codec
410417
.encode(Message::Chunk(None), &mut this.write_buf)?;
@@ -413,16 +420,19 @@ where
413420
this.state.set(State::None);
414421
continue 'res;
415422
}
423+
416424
Poll::Ready(Some(Err(e))) => {
417425
return Err(DispatchError::Service(e))
418426
}
427+
419428
Poll::Pending => return Ok(PollResponse::DoNothing),
420429
}
421430
}
422431
// buffer is beyond max size.
423432
// return and try to write the whole buffer to io stream.
424433
return Ok(PollResponse::DrainWriteBuf);
425434
}
435+
426436
StateProj::ExpectCall(fut) => match fut.poll(cx) {
427437
// expect resolved. write continue to buffer and set InnerDispatcher state
428438
// to service call.

src/lib.rs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
//! * SSL support using OpenSSL or Rustls
5757
//! * Middlewares ([Logger, Session, CORS, etc](https://actix.rs/docs/middleware/))
5858
//! * Includes an async [HTTP client](https://actix.rs/actix-web/actix_web/client/index.html)
59-
//! * Supports [Actix actor framework](https://github.com/actix/actix)
6059
//! * Runs on stable Rust 1.46+
6160
//!
6261
//! ## Crate Features
@@ -203,29 +202,3 @@ pub mod dev {
203202
}
204203
}
205204
}
206-
207-
pub mod client {
208-
//! Actix Web async HTTP client.
209-
//!
210-
//! ```rust
211-
//! use actix_web::client::Client;
212-
//!
213-
//! #[actix_web::main]
214-
//! async fn main() {
215-
//! let mut client = Client::default();
216-
//!
217-
//! // Create request builder and send request
218-
//! let response = client.get("http://www.rust-lang.org")
219-
//! .insert_header(("User-Agent", "actix-web/3.0"))
220-
//! .send() // <- Send request
221-
//! .await; // <- Wait for response
222-
//!
223-
//! println!("Response: {:?}", response);
224-
//! }
225-
//! ```
226-
227-
pub use awc::error::*;
228-
pub use awc::{
229-
test, Client, ClientBuilder, ClientRequest, ClientResponse, Connector,
230-
};
231-
}

src/test.rs

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1246,57 +1246,4 @@ mod tests {
12461246
let res = app.call(req).await.unwrap();
12471247
assert!(res.status().is_success());
12481248
}
1249-
1250-
#[actix_rt::test]
1251-
async fn test_actor() {
1252-
use crate::Error;
1253-
use actix::prelude::*;
1254-
1255-
struct MyActor;
1256-
1257-
impl Actor for MyActor {
1258-
type Context = Context<Self>;
1259-
}
1260-
1261-
struct Num(usize);
1262-
1263-
impl Message for Num {
1264-
type Result = usize;
1265-
}
1266-
1267-
impl Handler<Num> for MyActor {
1268-
type Result = usize;
1269-
1270-
fn handle(&mut self, msg: Num, _: &mut Self::Context) -> Self::Result {
1271-
msg.0
1272-
}
1273-
}
1274-
1275-
let addr = MyActor.start();
1276-
1277-
async fn actor_handler(
1278-
addr: Data<Addr<MyActor>>,
1279-
) -> Result<impl Responder, Error> {
1280-
let res = addr
1281-
.send(Num(1))
1282-
.await
1283-
.map_err(crate::error::ErrorInternalServerError)?;
1284-
1285-
if res == 1 {
1286-
Ok(HttpResponse::Ok())
1287-
} else {
1288-
Ok(HttpResponse::BadRequest())
1289-
}
1290-
}
1291-
1292-
let srv = App::new()
1293-
.data(addr.clone())
1294-
.service(web::resource("/").to(actor_handler));
1295-
1296-
let app = init_service(srv).await;
1297-
1298-
let req = TestRequest::post().uri("/").to_request();
1299-
let res = app.call(req).await.unwrap();
1300-
assert!(res.status().is_success());
1301-
}
13021249
}

0 commit comments

Comments
 (0)