1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-06-26 19:47:43 +02:00

solve framed integration with actix-http (#179)

This commit is contained in:
Rob Ede
2020-08-18 23:27:37 +01:00
committed by GitHub
parent fecdfcd8d4
commit b3010c13e0
13 changed files with 84 additions and 77 deletions

View File

@ -4,6 +4,7 @@
* Upgrade `tokio-util` to `0.3`.
* Remove unsound custom Cell and use `std::cell::RefCell` instead, as well as `actix-service`.
* Rename method to correctly spelled `LocalWaker::is_registered`.
## [1.0.6] - 2020-01-08

View File

@ -7,7 +7,7 @@ use crate::task::LocalWaker;
#[derive(Clone)]
/// Simple counter with ability to notify task on reaching specific number
///
/// Counter could be cloned, total ncount is shared across all clones.
/// Counter could be cloned, total n-count is shared across all clones.
pub struct Counter(Rc<CounterInner>);
struct CounterInner {

View File

@ -1,5 +1,7 @@
//! Framed dispatcher service and related utilities
#![allow(type_alias_bounds)]
use std::pin::Pin;
use std::task::{Context, Poll};
use std::{fmt, mem};

View File

@ -152,7 +152,7 @@ mod tests {
}
#[actix_rt::test]
async fn test_newtransform() {
async fn test_new_transform() {
let wait_time = Duration::from_millis(50);
let srv = apply(InFlight::new(1), fn_factory(|| ok(SleepService(wait_time))));

View File

@ -1,11 +1,12 @@
//! Actix utils - various helper services
#![deny(rust_2018_idioms)]
#![allow(clippy::type_complexity)]
pub mod condition;
pub mod counter;
pub mod dispatcher;
pub mod either;
pub mod framed;
pub mod inflight;
pub mod keepalive;
pub mod mpsc;

View File

@ -170,7 +170,7 @@ pub struct PReceiver<T> {
inner: Rc<RefCell<Slab<PoolInner<T>>>>,
}
// The oneshots do not ever project Pin to the inner T
// The one-shots do not ever project Pin to the inner T
impl<T> Unpin for PReceiver<T> {}
impl<T> Unpin for PSender<T> {}

View File

@ -231,7 +231,7 @@ mod tests {
}
#[actix_rt::test]
async fn test_inorder() {
async fn test_in_order() {
let (tx1, rx1) = oneshot::channel();
let (tx2, rx2) = oneshot::channel();
let (tx3, rx3) = oneshot::channel();

View File

@ -36,7 +36,7 @@ impl LocalWaker {
#[inline]
/// Check if waker has been registered.
pub fn is_registed(&self) -> bool {
pub fn is_registered(&self) -> bool {
unsafe { (*self.waker.get()).is_some() }
}

View File

@ -173,7 +173,7 @@ mod tests {
///
/// Expected Behavior: Two back-to-back calls of `LowResTimeService::now()` return the same value.
#[actix_rt::test]
async fn lowres_time_service_time_does_not_immediately_change() {
async fn low_res_time_service_time_does_not_immediately_change() {
let resolution = Duration::from_millis(50);
let time_service = LowResTimeService::with(resolution);
assert_eq!(time_service.now(), time_service.now());
@ -210,7 +210,7 @@ mod tests {
/// Expected Behavior: Two calls of `LowResTimeService::now()` made in subsequent resolution interval return different values
/// and second value is greater than the first one at least by a resolution interval.
#[actix_rt::test]
async fn lowres_time_service_time_updates_after_resolution_interval() {
async fn low_res_time_service_time_updates_after_resolution_interval() {
let resolution = Duration::from_millis(100);
let wait_time = Duration::from_millis(300);
let time_service = LowResTimeService::with(resolution);

View File

@ -220,7 +220,7 @@ mod tests {
}
#[actix_rt::test]
async fn test_timeout_newservice() {
async fn test_timeout_new_service() {
let resolution = Duration::from_millis(100);
let wait_time = Duration::from_millis(500);