MCPcopy Create free account
hub / github.com/NthTensor/Forte / scope_linear_stack_growth

Function scope_linear_stack_growth

src/scope.rs:1402–1423  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1400 cx: &mut Context<'_>,
1401 ) -> Poll<Self::Output> {
1402 if self.count == 128 {
1403 Poll::Ready(())
1404 } else {
1405 self.count += 1;
1406 cx.waker().wake_by_ref();
1407 Poll::Pending
1408 }
1409 }
1410 }
1411
1412 /// Tests that we can spawn futures onto a scope, and that the scope really
1413 /// does poll wait for the future to complete before returning.
1414 #[test]
1415 fn scope_pending_future() {
1416 static THREAD_POOL: ThreadPool = ThreadPool::new();
1417 THREAD_POOL.resize_to_available();
1418
1419 THREAD_POOL.scope(|scope| scope.spawn(CountFuture::default()));
1420
1421 THREAD_POOL.depopulate();
1422 }
1423
1424 /// Tests that a future that sleeps for a nontrivial amount of time does not
1425 /// cause the scope to exit early.
1426 #[test]

Callers

nothing calls this directly

Calls 5

scopeFunction · 0.85
the_final_countdownFunction · 0.85
resize_to_availableMethod · 0.80
with_workerMethod · 0.80
depopulateMethod · 0.80

Tested by

no test coverage detected