Reputation: 36044
When Azure Function is declared to be async, how does it affect the client that calls it?
Take an example of an Angular HTTP client that calls the Azure Function. What is the difference if the Angular app calls asynchronous vs synchronous function? Wouldn't the HTTP client object still wait for the response from the function in either case?
Upvotes: 0
Views: 649
Reputation: 13234
There is no difference to the caller. The Angular application cannot tell the difference.
The difference is that an async
C# method is allowed to await tasks. If the Azure Function calls async code, it should await it, and thus needs to be async itself.
Upvotes: 1