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

#506 anyio integration #507

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

madkote
Copy link

@madkote madkote commented Feb 21, 2023

What do these changes do?

Are there changes in behavior for the user?

Related issue number

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • Add a new news fragment into the CHANGES folder
    • name it <issue_id>.<type> (e.g. 588.bugfix)
    • if you don't have an issue_id change it to the pr id after creating the PR
    • ensure type is one of the following:
      • .feature: Signifying a new feature.
      • .bugfix: Signifying a bug fix.
      • .doc: Signifying a documentation improvement.
      • .removal: Signifying a deprecation or removal of public API.
      • .misc: A ticket has been closed, but it is not of interest to users.
    • Make sure to use full sentences with correct case and punctuation, for example: Fix issue with non-ascii contents in doctest text files.


def _notify_sync_not_full(self) -> None:
def f() -> None:
with self._sync_mutex:
self._sync_not_full.notify()

fut = asyncio.ensure_future(self._loop.run_in_executor(None, f))
fut = asyncio.ensure_future(anyio.to_thread.run_sync(f, *[]))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think there is any interest to support anyio between maintainers, this is asyncio library after all. I do not have experience with it, but may be anyio can provide custom executor so self._loop.run_in_executor can call anyio.to_thread.run_sync(f, *[]) ? Then there is not need to change library itself much, other then may be provide executor for the loop.

@asvetlov
Copy link
Member

Looking at the source, PR still keeps strong dependency on asyncio.Queue but only replaces run_in_executor(...) with anyio.to_thread.run_sync(...).
What is the point if after PR applied it still don't work with, e.g., trio?

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

Successfully merging this pull request may close these issues.

3 participants