mirror of https://github.com/pulumi/pulumi.git
97f99d7fa1
The `nodejs` language support is implemented as two programs: one that manages the initial connection to the engine and provides the language serivce itself, and another that the language service invokes in order to run a `nodejs` Pulumi program. The latter is responsible for running the user's program and communicating its resource requests to the engine. Currently, `run` effectively assumes that the user's program will run synchronously from start to finish, and will disconnect from the engine once the user's program has completed. This assumption breaks if the user's program requires multiple turns of the event loop to finish its root resource requests. For example, the following program would fail to create its second resource because the engine will be disconnected once it reaches its `await`: ``` (async () => { let a = new Resource(); await somePromise(); let = new Resource(); })(); ``` These changes fix this issue by disconnecting from the engine during process shutdown rather than after the user's program has finished its first turn through the event loop. |
||
---|---|---|
.. | ||
multiple-turns | ||
simple |