This message was deleted.
# dotnet
s
This message was deleted.
👀 1
b
actually, i may have answered my own question, but leads me to another question - does the pulumi engine execute the resource plugin binary once for each time a provider from that plugin is created? i added some more logging and debugging, and it looks like if i create 2 provider instances inside my pulumi stack, the plugin binary was being ran at least twice. if that is the case, is it safe to just store my provider-specific http client inside a private static field? seems like each provider instance may be isolated in different .net processes
e
if that is the case, is it safe to just store my provider-specific http client inside a private static field? seems like each provider instance may be isolated in different .net processes
private instance fields should work. I'll look into this for you! The intention is supposed to be your "Provider" object gets created once when the engine attaches, then the engine call configure allowing you to set up any instance state, and then everything else gets called. I have probably just screwed something up in the AspNet DI layer and not told it that providers should be singletons. For the time being static state will probably be a good workaround, the engine will start a whole new process for each provider instance it sees so you should be safe using static state.
b
awesome thank you so much!
e
https://github.com/pulumi/pulumi-dotnet/pull/105 Might be a bit before it gets released, company is on a holiday week this week so the next dotnet release will probably be the 1st March.
b
ah great thanks for the speedy resolution 🎊