Skip to content
New issue

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

Cancel a pending open() call #157

Open
DaveCausey opened this issue Feb 9, 2023 · 1 comment
Open

Cancel a pending open() call #157

DaveCausey opened this issue Feb 9, 2023 · 1 comment

Comments

@DaveCausey
Copy link

I'm using aiofiles to read from a named pipe, which doesn't actually complete until the pipe is opened elsewhere for writing, so the read loop spends most of its time in that state. As far as I can tell, there is no way to cancel the open once it is called and clean up or gracefully exit the application.

@Tinche
Copy link
Owner

Tinche commented Feb 12, 2023

The way aiofiles works is by wrapping blocking calls in a function that uses threads. This unfortunately has inherent limitations, for example threads can't be portably and safely cancelled, unlike asyncio tasks. So I'm not sure what to do here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants