actually do some awaiting in the async limiter, which doesnt work
something tls-related is not right
This commit is contained in:
@@ -510,6 +510,8 @@ impl ResourceLimiterAsync for MemoryContext {
|
|||||||
desired: usize,
|
desired: usize,
|
||||||
maximum: Option<usize>,
|
maximum: Option<usize>,
|
||||||
) -> bool {
|
) -> 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)
|
// Check if the desired exceeds a maximum (either from Wasm or from the host)
|
||||||
assert!(desired < maximum.unwrap_or(usize::MAX));
|
assert!(desired < maximum.unwrap_or(usize::MAX));
|
||||||
|
|
||||||
@@ -808,6 +810,8 @@ impl ResourceLimiterAsync for FailureDetector {
|
|||||||
desired: usize,
|
desired: usize,
|
||||||
_maximum: Option<usize>,
|
_maximum: Option<usize>,
|
||||||
) -> bool {
|
) -> 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_current = current;
|
||||||
self.memory_desired = desired;
|
self.memory_desired = desired;
|
||||||
true
|
true
|
||||||
|
|||||||
Reference in New Issue
Block a user