struct ClientContext<'c,C> {
ic: &'c InstanceConfig,
hclient: &'c Arc<hyper::Client<C>>,
- reporter: &'c parking_lot::Mutex<Reporter<'c>>,
+ reporter: &'c Reporter<'c>,
}
#[throws(AE)]
Ok::<_,AE>(resp)
}).await? }.await;
- let r = c.reporter.lock().report(Some(req_num), r);
+ let r = c.reporter.report(Some(req_num), r);
if r.is_none() {
tokio::time::sleep(c.ic.http_retry).await;
{
debug!("{}: config: {:?}", &ic, &ic);
- let reporter = parking_lot::Mutex::new(Reporter::new(&ic));
+ let reporter = Reporter::new(&ic);
let c = ClientContext {
reporter: &reporter,
},
_ = async { },
- if reporter.lock().report(None, {
+ if reporter.report(None, {
if rx_queue.remaining() < ic.max_batch_down.sat() * 3 /* xxx */ {
// xxx make this separate option ? docs say server only
Ok(())
ic
} }
- pub fn report<T>(&mut self, req_num: Option<ReqNum>, r: Result<T,AE>)
+ pub fn report<T>(&self, req_num: Option<ReqNum>, r: Result<T,AE>)
-> Option<T> {
match r {
Ok(t) => {