actually do some awaiting in the async limiter, which doesnt work

something tls-related is not right
This commit is contained in:
Pat Hickey
2021-10-22 16:12:07 -07:00
parent 5f978dbfdd
commit fb549c6ddb

View File

@@ -510,6 +510,8 @@ impl ResourceLimiterAsync for MemoryContext {
desired: usize,
maximum: Option<usize>,
) -> bool {
// Show we can await in this async context:
tokio::time::sleep(std::time::Duration::from_millis(1)).await;
// Check if the desired exceeds a maximum (either from Wasm or from the host)
assert!(desired < maximum.unwrap_or(usize::MAX));
@@ -808,6 +810,8 @@ impl ResourceLimiterAsync for FailureDetector {
desired: usize,
_maximum: Option<usize>,
) -> bool {
// Show we can await in this async context:
tokio::time::sleep(std::time::Duration::from_millis(1)).await;
self.memory_current = current;
self.memory_desired = desired;
true