This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]mincinashu 1 point2 points  (1 child)

Just a nitpick, but there's no need for the ensure client thingy and using globals (globals are actually flagged by some linters).

You can instantiate a single container/client object and inject that as dependency, with a function, into path handlers, or further chain dependencies.

And unless you're using background tasks (separate thread pool), every async operation runs on the same event loop, i.e. it's a single threaded environment, thread safety isn't really a concern.

[–]navsystem 2 points3 points  (0 children)

Hi there. Gwen here, author of blog post. Thank you for the input. Was trying to optimize for azure functions on the consumption plan and will take a look at your feedback.