pulumi/sdk/nodejs/runtime
Alex Clemmer 038f920dc3 Make streamInvoke gracefully-cancellable from SDKs
The @pulumi/pulumi TypScript SDK exposes `streamInvoke`, which returns a
(potentially infinite) stream of responses. This currently is _assumed_
to be infinite, in that there is no way to signal cancellation, and
prevents Pulumi from being able to clean up when we're finished using
the results of the `streamInvoke`.

This commit will introduce a `StreamInvokeResult` type, which is an
`AsyncIterable` that also exposes a `cancel` function, whih does just
this.

Use it like this:

    // `streamInvoke` to retrieve all updates to any `Deployment`, enumerate 0
    // updates from the stream, then `cancel` giving the Kubernetes provider to
    // clean up and close gracefully.
    const deployments = await streamInvoke("kubernetes:kubernetes:watch", {
        group: "apps", version: "v1", kind: "Deployment",
        break;
    });
    deployments.cancel();
2019-11-05 10:47:48 -08:00
..
closure Perform our closure tree-shaking when the code contains element accesses, not just property accesses (#3295) 2019-10-02 23:34:09 -07:00
config.ts Do not lazy initialize config or settings 2018-08-06 15:53:38 -07:00
debuggable.ts make the context-param non-optional for debuggable promises. (#2242) 2018-11-24 18:57:17 -08:00
index.ts Actually export type. (#1971) 2018-09-21 11:58:58 -07:00
invoke.ts Make streamInvoke gracefully-cancellable from SDKs 2019-11-05 10:47:48 -08:00
resource.ts Remove unnecessary casts (#3367) 2019-10-17 17:12:45 -07:00
rpc.ts Add **preview** .NET Core support for pulumi. (#3399) 2019-10-25 16:59:50 -07:00
settings.ts New approach to move us to using deasync as little as possible (and with as little impact to users as possible). (#3325) 2019-10-14 22:08:06 -07:00
stack.ts Omit unknowns in resources in stack outputs during preview. (#3427) 2019-10-30 11:36:03 -07:00