I have a bit of dumbed down code here
Async Function GetCoolNumber() As Task(Of Double)
Dim n = Await GetNumberFromSomeAsyncSource()
If IsCool(n) Then
Return n
End If
Return Await GetCoolNumber()
End Function
Private Function GetNumberFromSomeAsyncSource() As Task(Of Double)
Private Function IsCool(n As Object) As Boolean
Now the recursion works fine and I get the result I want. My real code is more complex of course. However is this considered bad practice?
What if I did infinite recursion this way? Would something blow? My gut feeling is that I would keep dumping tasks onto the heap rather than blowing my stack.