Skip to content
This repository has been archived by the owner on Jun 25, 2018. It is now read-only.

Replace loop.current_task() with officially supported API #106

Open
asvetlov opened this issue Mar 12, 2018 · 4 comments
Open

Replace loop.current_task() with officially supported API #106

asvetlov opened this issue Mar 12, 2018 · 4 comments
Assignees

Comments

@asvetlov
Copy link

loop.current_task() was never a part of asyncio API.
Starting from 3.7 third party loops can use dedicated calls for custom task implementation:
asyncio._register_task, ``asyncio._unregister_task, asyncio._enter_task`, `asyncio._leave_task`.

The API calls are started from underscore to emphasize these very low level position (should be used by libraries like tokio only) but they are a part of of official API.

@fafhrd91 fafhrd91 self-assigned this Mar 12, 2018
@fafhrd91
Copy link
Collaborator

I don't remember if I put anything into aiohttp. feel free to replace it with proper api calls. I will change tokio loop later

@asvetlov
Copy link
Author

@fafhrd91 cool.
Thank you to picking up the issue.
I have no rust/tokio experience.

aiohttp uses this functionality: https://github.com/aio-libs/aiohttp/blob/master/aiohttp/helpers.py#L182-L191

Now I'm adding asyncio.current_task() support for Python 3.7 to avoid PendingDeprecationWarning.

I'll support tokio for a while but please fix the issue in a reasonable time.

@fafhrd91
Copy link
Collaborator

Ok

@asvetlov
Copy link
Author

Cross-link: aio-libs/aiohttp#2826

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

No branches or pull requests

2 participants