replace yields point with consume_budget
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
8fedc358e0
commit
7680d1bd5e
2 changed files with 4 additions and 3 deletions
|
@ -757,7 +757,6 @@ async fn load_joined_room(
|
||||||
};
|
};
|
||||||
|
|
||||||
delta_state_events.push(pdu);
|
delta_state_events.push(pdu);
|
||||||
tokio::task::yield_now().await;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,9 +2,10 @@ use std::{convert::AsRef, fmt::Debug, future::Future, io::Write};
|
||||||
|
|
||||||
use arrayvec::ArrayVec;
|
use arrayvec::ArrayVec;
|
||||||
use conduit::{err, implement, utils::IterStream, Result};
|
use conduit::{err, implement, utils::IterStream, Result};
|
||||||
use futures::{future::ready, Stream};
|
use futures::{FutureExt, Stream};
|
||||||
use rocksdb::DBPinnableSlice;
|
use rocksdb::DBPinnableSlice;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
use tokio::task;
|
||||||
|
|
||||||
use crate::{ser, util, Handle};
|
use crate::{ser, util, Handle};
|
||||||
|
|
||||||
|
@ -55,7 +56,8 @@ pub fn get<K>(&self, key: &K) -> impl Future<Output = Result<Handle<'_>>> + Send
|
||||||
where
|
where
|
||||||
K: AsRef<[u8]> + ?Sized + Debug,
|
K: AsRef<[u8]> + ?Sized + Debug,
|
||||||
{
|
{
|
||||||
ready(self.get_blocking(key))
|
let result = self.get_blocking(key);
|
||||||
|
task::consume_budget().map(move |()| result)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Fetch a value from the database into cache, returning a reference-handle.
|
/// Fetch a value from the database into cache, returning a reference-handle.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue