but I have to await it, which kinda suggests this ...
# python
l
but I have to await it, which kinda suggests this is not something I should be using
w
The API design is a little different here - but it is indeed designed to be used. Since the call doesn't have any dependencies - it doesn't need to be an
Output
, so these calls are projected as returning an async function. Not sure if we have any good examples of using these in common patterns in Python. @incalculable-sundown-82514 might know.
l
so I have to use await? I tried a bunch of examples from SO, with no result. I'm not a python developer so not much experience here, sadly
i
The way that I recommend using these functions is to invoke them in an
async
function and then invoke the function as an invoke for a resource, sort of like this: https://github.com/pulumi/pulumi/blob/6f386567f6a8494853bee8fccdb455b3be1a993b/sdk/python/lib/test/langhost/invoke/__main__.py#L34-L38 You can pass futures (the return value of
async
functions) directly to resource constructors.
l
ok, trying to comprehend that 😉
ok, that worked, thanks!