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

Wrap the task returned by xru.RunInTranslation to automatically wait #10

Open
secretlyagoblin opened this issue Nov 16, 2020 · 2 comments

Comments

@secretlyagoblin
Copy link

Hey there,

Breaking change, but just got caught up again by not having Wait() at the end of the xru task. I'm not 100% clear on whats happening here, but if we always have to wait for the tasks to work with revit, can we just automatically append it to prevent user error, especially when the failures are hard to diagnose as they 'fail' silently?

@teocomi
Copy link
Member

teocomi commented Dec 8, 2020

Hey @secretlyagoblin the Wait is there because the task is async, I think a better implementation could be to have two methods like RunInTransaction and RunInTransactionAsync, which would also make it clearer that one has to be awaited and the other hasn't!

@secretlyagoblin
Copy link
Author

Oh interesting, I thought the Async + Wait was a hack to get around some revit issue - maybe the comment in your docs needs a bit more explanation as to why it follows this pattern?

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

No branches or pull requests

2 participants