Are Async Macro Methods Supported in Kentico 12 Portal Engine?

kentico guy asked on December 4, 2020 23:13

Are async methods supported in custom Macro methods? I'm using the syntax with extended macro container like this:

XXXXContainer : MacroMethodContainer { }

Can my code await async Task returns if the Macro method is calling? Or what's the recommended way to do this if the macro methods need to await a response? I found some really buggy code in this app and the previous dev was using .Result calls which I think are causing deadlocks. I am trying to rewrite this so that we're using Task and await as I've learned from experience that .Result does not work very well.

Please advise

Correct Answer

Brenden Kehren answered on December 8, 2020 15:09

No.

1 votesVote for this answer Unmark Correct answer

Recent Answers


kentico guy answered on December 7, 2020 18:52

Really, noone? This is a pretty simple question. I'd settle for a simple yes or no haha

0 votesVote for this answer Mark as a Correct answer

kentico guy answered on February 12, 2021 13:57 (last edited on February 12, 2021 15:08)

@Brenden Kehren LOL!!

0 votesVote for this answer Mark as a Correct answer

kentico guy answered on February 12, 2021 15:06

Just an FYI you can get around this using await and a high timeout ms on the macro. it may not be officially supported but it kinda works; however, the high timeout does not work reliably and will throw exceptions

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.