Skip to content

make @trace decorator support async functions#92

Merged
kezhenxu94 merged 7 commits into
apache:masterfrom
taskmgr:master
Dec 9, 2020
Merged

make @trace decorator support async functions#92
kezhenxu94 merged 7 commits into
apache:masterfrom
taskmgr:master

Conversation

@taskmgr

@taskmgr taskmgr commented Nov 30, 2020

Copy link
Copy Markdown
Contributor

@taskmgr taskmgr changed the title 修复trace和asyncio共用时的问题 [WIP]修复trace和asyncio共用时的问题 Nov 30, 2020
@kezhenxu94

Copy link
Copy Markdown
Member

Please always use English in GitHub issues and mailing list

@kezhenxu94 kezhenxu94 added core enhancement New feature or request labels Nov 30, 2020
@kezhenxu94 kezhenxu94 added this to the 0.5.0 milestone Nov 30, 2020
@taskmgr taskmgr changed the title [WIP]修复trace和asyncio共用时的问题 [WIP]fix incorrect trace when using async decorator Dec 1, 2020

@kezhenxu94 kezhenxu94 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You should define 2 wrapper functions, one for ordinary(the original version) and one for async,

@taskmgr

taskmgr commented Dec 1, 2020

Copy link
Copy Markdown
Contributor Author

You should define 2 wrapper functions, one for ordinary(the original version) and one for async,

I've committed a new version.

@kezhenxu94

Copy link
Copy Markdown
Member

@taskmgr tests passed, please consider refactor the two functions to extract the common codes

@kezhenxu94 kezhenxu94 changed the title [WIP]fix incorrect trace when using async decorator make @trace decorator support async functions Dec 9, 2020

@kezhenxu94 kezhenxu94 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks

@kezhenxu94 kezhenxu94 merged commit 3890372 into apache:master Dec 9, 2020
kezhenxu94 added a commit that referenced this pull request Dec 10, 2020
kezhenxu94 added a commit that referenced this pull request Dec 10, 2020
kezhenxu94 added a commit that referenced this pull request Dec 10, 2020
kezhenxu94 added a commit that referenced this pull request Dec 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Python] Make the decorator trace support async, await functions

2 participants