In python I think the solution would be to block t...
# general
m
In python I think the solution would be to block the synchronous thread waiting for a signal, and then send the signal inside the apply(). But javascript is single threaded so that is not possible. so when you call getOutputSync it just sits in a loop running tasks that have already been started, until the output is satisfied. The reason it hangs is that the single javascript thread is blocked waiting for outputs to complete that can't complete until future stuff in your program is processed. that may include actions that are initiated by pulumi after the end of your program. I guess its a bug but I'm a little surprised getOutputSync was provided since it is an antipattern.
b
not sure what you mean by actions that are initiated by pulumi after the end of the program btw, this simple program just hangs:
import * as pulumi from '@pulumi/pulumi'
const infra = new pulumi.StackReference('core_infra-global')
const accounts: any = infra.getOutputSync('accounts')