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

Async ILogManager.ExecuteSection() #834

Closed
Piedone opened this issue Apr 23, 2024 · 4 comments
Closed

Async ILogManager.ExecuteSection() #834

Piedone opened this issue Apr 23, 2024 · 4 comments

Comments

@Piedone
Copy link

Piedone commented Apr 23, 2024

Since ILogManager.Start() is now deprecated, one must use ILogManager.ExecuteSection() to wrap code into log sections. However, if your code is async, this won't really work. Sync-over-async is a big no-no, and ExecuteSection<TResult>() will end the section before the async operation completes (since it doesn't know about async).

So, please add an async ILogManager.ExecuteSectionAsync() that accepts and async function, i.e. Func<Task> and an overload with Func<Task<TResult>>.

@YevgeniyShunevych
Copy link
Member

Absolutely agree. I had ExecuteSectionAsync in my TODO list. Will add that in Atata v3.1.

Please let me know if you find any other issues related to v3 migration so I can handle them in v3.1 as well.

@Piedone
Copy link
Author

Piedone commented Apr 23, 2024

Great, thank you!

Only this and #835 are what I've found for now. Since this is a blocker, I can't continue to see if there are any other issues. But if you publish a prerelease, I'd be happy to test it.

@YevgeniyShunevych
Copy link
Member

I added ExecuteSectionAsync methods by #836. Released it with Atata v3.1.0.

@Piedone
Copy link
Author

Piedone commented Apr 30, 2024

It works, thank you!

@Piedone Piedone closed this as completed May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants