We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TrioExecutor
TrioExecutor shares the limiter with the underlying trio.to_thread.run_sync call, so more tokens are consumed than are intended.
trio.to_thread.run_sync
Reproducible example:
import asyncio import trio_asyncio async def amain(): loop = asyncio.get_event_loop() executor = trio_asyncio.TrioExecutor(max_workers=1) await loop.run_in_executor(executor, print, "hello") trio_asyncio.run(trio_asyncio.aio_as_trio(amain))
This call will always block, as TrioExecutor acquires the only token available and the inner trio.to_thread.run_sync cannot acquire its own token.
The text was updated successfully, but these errors were encountered:
Since trio.to_thread.run_sync always acquires a token before spawning a thread, it seems sufficient to remove capacity limiter acquire/release in the TrioExecutor.submit implementation.
TrioExecutor.submit
Sorry, something went wrong.
No branches or pull requests
TrioExecutor
shares the limiter with the underlyingtrio.to_thread.run_sync
call, so more tokens are consumed than are intended.Reproducible example:
This call will always block, as
TrioExecutor
acquires the only token available and the innertrio.to_thread.run_sync
cannot acquire its own token.The text was updated successfully, but these errors were encountered: