Hi,
I am using the ResumableSub in my project with a HTTPJob, and it will then return the request back to the Sub like the following (as an example):
Let's say in the ResumableSub 'GetPage' it fails to get the value from the page for some reason. How do I make the ResumableSub do the request again, so it can try and get the value again and return a value to the original request in the RunMe sub ?
I am using the ResumableSub in my project with a HTTPJob, and it will then return the request back to the Sub like the following (as an example):
B4X:
Sub RunMe
Dim rs As ResumableSub = GetPage
Wait For(rs) Complete (Result As String)
Log(Result)
End Sub
Sub GetPage As ResumableSub
Dim j As HttpJob
j.Initialize("", Me)
j.Download("https://www.google.com")
Wait For (j) JobDone(j As HttpJob)
Dim ValueToReturn As String
If j.Success Then
ValueToReturn = j.GetString
Else
Log("error")
End If
j.Release
Return ValueToReturn
End Sub
Let's say in the ResumableSub 'GetPage' it fails to get the value from the page for some reason. How do I make the ResumableSub do the request again, so it can try and get the value again and return a value to the original request in the RunMe sub ?