dev.e.loper
dev.e.loper

Reputation: 36044

How does making an Azure Function asynchronous affect the caller

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

Answers (1)

Stephen Jennings
Stephen Jennings

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

Related Questions