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

Add run_sync and ensure_async functions #315

Merged
merged 2 commits into from Nov 24, 2022

Conversation

davidbrochart
Copy link
Member

  • ensure_async is used in jupyter-client, jupyter-server and nbclient.
  • run_sync is used in jupyter-client and nbclient.

See jupyter/nbclient#259.

@blink1073
Copy link
Member

Mind adding tests?

Copy link
Member

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

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

Thank you!

@blink1073 blink1073 merged commit 51b8a12 into jupyter:main Nov 24, 2022
@blink1073
Copy link
Member

@meeseeksdev please backport to 4.x

@davidbrochart davidbrochart deleted the sync_async branch November 24, 2022 16:33
@lumberbot-app
Copy link

lumberbot-app bot commented Nov 24, 2022

Oops, something went wrong applying the patch ... Please have a look at my logs.

@blink1073
Copy link
Member

From the log, it is a merge conflict, but for some reason the bot didn't give the usual message:

2022-11-24T16:33:26.629857+00:00 app[web.1]: hint: To abort and get back to the state before "git cherry-pick",

2022-11-24T16:33:26.629858+00:00 app[web.1]: hint: run "git cherry-pick --abort".'

2022-11-24T16:33:26.629861+00:00 app[web.1]:     [backport] ----

2022-11-24T16:33:26.629863+00:00 app[web.1]:     [backport] 

2022-11-24T16:33:26.629863+00:00 app[web.1]:   stdout: 'Auto-merging jupyter_core/utils/__init__.py

2022-11-24T16:33:26.629865+00:00 app[web.1]: CONFLICT (content): Merge conflict in jupyter_core/utils/__init__.py'

2022-11-24T16:33:26.629920+00:00 app[web.1]:     [backport] ----

@davidbrochart
Copy link
Member Author

davidbrochart commented Nov 24, 2022

I think @fcollonval was having issues with meeseeks lately too.

blink1073 pushed a commit to blink1073/jupyter_core that referenced this pull request Nov 24, 2022
@Carreau
Copy link
Member

Carreau commented Dec 22, 2022

Small afer the fact question, why ensure_async(func(param)), which can be problematic if func() can already return an awaitable, and not ensure_asyncfunc(func)(param), that can use inspect.iscoroutinefunction() to make sure func is itself async ?

@davidbrochart
Copy link
Member Author

We just didn't face this situation, but I agree it would have been more generic.

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

Successfully merging this pull request may close these issues.

None yet

3 participants