https://pulumi.com logo
#golang
Title
# golang
b

bright-sandwich-93783

07/06/2021, 8:18 PM
ApplyTWithContext
mentions that the provided context can be used to reject the output as cancelled. If I call the context
cancel
method, what am I supposed to expect?
ApplyTWithContext
only returns a single value of type
Output
. As a caller of
ApplyTWithContext
how am I supposed to detect a "rejected output"?
b

bored-table-20691

07/08/2021, 10:56 PM
@bright-sandwich-93783 I believe you can have an applier function that returns an error: https://pkg.go.dev/github.com/pulumi/pulumi/sdk@v1.14.1/go/pulumi#OutputState.ApplyT
You can also see in the code that an Output (e.g. StringOutput) will internally store whether it is rejected/errored: https://github.com/pulumi/pulumi/blob/sdk/v3.6.1/sdk/go/pulumi/types.go#L77
8 Views