tall-needle-56640
01/13/2021, 11:01 PMprivate static void FunctionDoesNotFinish(Output<string> someValue)
{
_ = someValue.Apply<string?>(async c =>
{
Console.WriteLine("Start");
for (int i = 0; i <= 1000; i++)
{
Console.WriteLine(i);
await Task.Delay(1);
}
Console.WriteLine("End");
return null;
});
}
And here is the output:
Diagnostics:
pulumi😛ulumi:Stack (AzureSqlAad-dev-asa2):
Start
0
1
2
3Numbers 4-100 never appear. I'm guessing
Output.Create
might be recommended, but I can't get that to work either.
private static void FunctionDoesNotFinish(Output<string> someValue)
{
_ = someValue.Apply<string?>(s => Output.Create<string?>(SomeMethod()));
}
private static async Task<string?> SomeMethod()
{
Console.WriteLine("Start");
for (int i = 0; i <= 1000; i++)
{
Console.WriteLine(i);
await Task.Delay(1);
}
Console.WriteLine("End");
return null;
}
NOTE: My actual code is just adding a user to the DB, so I don't actually care about the return value.
@tall-librarian-49374tall-librarian-49374
01/14/2021, 8:13 AMApply
. We expect you to “register” all outputs somewhere in resource model so that we know we need to await it.RegisterOutputs
in our .NET SDK source code to get a sense of what’s going on there.tall-needle-56640
01/14/2021, 3:16 PM