mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Non-blocking network IO
This commit is contained in:
parent
f77e66bbf8
commit
903e0cd857
13 changed files with 475 additions and 345 deletions
|
@ -8,7 +8,6 @@
|
|||
//! and <http://tools.ietf.org/html/rfc7232>.
|
||||
|
||||
use crate::fetch::methods::{Data, DoneChannel};
|
||||
use crossbeam_channel::{unbounded, Sender};
|
||||
use headers::{
|
||||
CacheControl, ContentRange, Expires, HeaderMapExt, LastModified, Pragma, Range, Vary,
|
||||
};
|
||||
|
@ -30,6 +29,7 @@ use std::sync::atomic::{AtomicBool, Ordering};
|
|||
use std::sync::Mutex;
|
||||
use std::time::SystemTime;
|
||||
use time::{Duration, Timespec, Tm};
|
||||
use tokio2::sync::mpsc::{unbounded_channel as unbounded, UnboundedSender as TokioSender};
|
||||
|
||||
/// The key used to differentiate requests in the cache.
|
||||
#[derive(Clone, Eq, Hash, MallocSizeOf, PartialEq)]
|
||||
|
@ -58,7 +58,7 @@ struct CachedResource {
|
|||
request_headers: Arc<Mutex<HeaderMap>>,
|
||||
body: Arc<Mutex<ResponseBody>>,
|
||||
aborted: Arc<AtomicBool>,
|
||||
awaiting_body: Arc<Mutex<Vec<Sender<Data>>>>,
|
||||
awaiting_body: Arc<Mutex<Vec<TokioSender<Data>>>>,
|
||||
data: Measurable<MeasurableCachedResource>,
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue