rmanoka / async-scoped

A scope for async_std and tokio to spawn non-static futures
117 stars 14 forks source link

Avoid blocking on dropping an empty scope #23

Closed akoshelev closed 7 months ago

akoshelev commented 8 months ago

There is a difference in drop behavior between scopes that were used to spawn futures and later drained and scopes that were created and never used. In the latter case, there is an unnecessary call to block_on.

This change addresses this by checking whether remaining is 0 inside drop.

akoshelev commented 7 months ago

@rmanoka thanks for approving this change. Is it possible to merge it? I'd love to prepare another PR to release it along with #19