/// Sent from hyper worker pool task to client task
#[allow(dead_code)] // xxx
+#[derive(Debug)]
struct WebRequest {
// initial part of body
// used up to and including first 2 lines of metadata
/// Reply from client task to hyper worker pool task
#[allow(dead_code)] // xxx
+#[derive(Debug)]
struct WebResponse {
warnings: Warnings,
data: Result<WebResponseData, AE>,
{
struct Outstanding {
reply_to: tokio::sync::oneshot::Sender<WebResponse>,
- max_requests_outstanding: u32,
+ oi: OutstandingInner,
+ }
+ #[derive(Debug)]
+ struct OutstandingInner {
+ target_requests_outstanding: u32,
}
let mut outstanding: VecDeque<Outstanding> = default();
let downbound: VecDeque<(/*xxx*/)> = default();
if ! downbound.is_empty() {
outstanding.pop_front()
} else if let Some((i,_)) = outstanding.iter().enumerate().find({
- |(_,o)| outstanding.len() > o.max_requests_outstanding.sat()
+ |(_,o)| outstanding.len() > o.oi.target_requests_outstanding.sat()
}) {
Some(outstanding.remove(i).unwrap())
} else {
warnings: default(),
};
+ dbg!(&response);
try_send_response(ret.reply_to, response);
}
}
while let Some(comp) = comps.next(&mut warnings, PartName::d)? {
+ if comp.name != PartName::d {
+ warnings.add(&format_args!("unexpected part {:?}", comp.name))?;
+ }
dbg!(comp.name, DumpHex(comp.payload));
}
- Ok::<_,AE>(())
+ let oi = OutstandingInner {
+ target_requests_outstanding,
+ };
+ Ok::<_,AE>(oi)
}.await {
- Ok(()) => outstanding.push_back(Outstanding {
- reply_to: reply_to,
- max_requests_outstanding: 42, // xxx
- }),
+ Ok(oi) => outstanding.push_back(Outstanding { reply_to, oi }),
Err(e) => {
try_send_response(reply_to, WebResponse {
data: Err(e),