sparse-intern-71089
05/26/2021, 3:02 PMbored-oyster-3147
05/26/2021, 3:21 PMOutput<T>
denotes that the underlying value relies on some asynchronous work
Input<T>
accepts constants, literals, or Output<T>
because it conveys that the input should wait on the asynchronous work
If your function parameter accepts Input<T>
than you could freely pass it literals, values that are known at compile time, or `Output<T>`s
If your function parameter accepts Output<T>
and you want to pass a string literal or value otherwise known at compile time, than you would need to do something like Output.Create(() => "literal"))
or Output.Create("literal")
which is a bit silly to create what is essentially a promise for a synchronous function/value when it wouldn't otherwise be necessary if your function accepted Input<T>
rough-window-15889
05/27/2021, 4:04 PMbored-oyster-3147
05/27/2021, 4:25 PMSo Input shows it should wait for the output being passed in and Output shows it should retain the meta data associated with the output.I'm not really understanding this interpretation. An
Output<T>
denotes an asynchronously acquired value. It will have dependency metadata if it comes from a resource, but it does not always have dependency metadata - because you can make outputs freely if you wish. An Input<T>
can be passed anything, and it is just smart enough to know that if it is passed an Output<T>
it will need to await
the underlying promise/task.
I would make your parameters accept Input<T>
.rough-window-15889
05/28/2021, 2:02 AMbored-oyster-3147
05/28/2021, 1:17 PM