hey, does ESC support or plans to support the scen...
# esc
g
hey, does ESC support or plans to support the scenario of config changes at runtime? E.g. the ability to have some kind of library that watches for config changes and then notifies the app if a change occured (and the app then changes that config or restarts itself)? E.g. something like https://cloud.google.com/deployment-manager/runtime-configurator/watching-a-variable ?
p
We have webhooks: https://www.pulumi.com/blog/esc-webhooks-launch/. would that work for your scenario?
g
hmm it goes in the right direction but not really for our scenario. What I want is to have in-process notifications of changes. An app should be able to read its own configuration at runtime and then get notified when that configuration has changed in a way. E.g. in code something like
Copy code
let configuration = {}

await esc.initConfigWatch('/myapp/config', function onUpdate(newConfig) {
   configuration = newConfig;
})

function myFancyAppHandler(request: string): string {
   return "Hello ${configuration.myparam}";
}
webhooks would be only useful for notifications to external deployment tooling imo, not to notify the app process itself (esp if there are multiple replicas).
p
I believe you want this one correct? https://github.com/pulumi/esc/issues/339
w
Yeah - 339 is tracking the feature that I understand @glamorous-printer-66548 is asking for here. Definitely something we want to add into SDKs soon!
g
how would this work from an API perspective? Is this really just an SDK change or does this need a new API? (E.g. would SDK do polling or something?) Btw, for us to be useful in most of our applications we would need a Rust SDK. We could probably build one ourselves if the API flow is pretty clear/simple though.