Hello I’m making a connection to my SQL database with PHP.
I can succesfully get all my data in UE4, but I need a timer to wait till I have all my data and then continue.
How can I pause my code after
Request->OnProcessRequestComplete().BindUObject(this, &ADataConnection::CompletedHTTPRequest);
Untill it finishes CompletedHTTPRequest?
Well you could make “Request” available for the whole class and just call another function at the end of “CompletedHTTPRequest” that then uses the variable again.
The thing is that I want to use only the function ConnectToDatabase because I made it useable in blueprints.
So that way I only need 1 function in the bluepritns. But when I execute the connecttodatabase it doesn’t wait for completedHTTPRequest like the function .wait() in c++.
And I was just thinking maybe calling a custom event at the end instead, but that’s something i will try out soon.
I got the first time working now with a custom event.
But my array gets 4 times the same value instead of 4 diffrent.
UE_LOG(MyLog, Warning, TEXT("%s"), *imagePath);
gives 4 diffrent values but
imagePaths.Add(imagePath);
gets 4 times the same values why?
I also tried to Add(*imagePath); but no succes.
I know this is old, but I’m going to comment because I was searching for a similar answer and came across this thread.
I think the method you are looking for in this case is the FHttpManager::Flush(bool). After doing a ProcessRequest() call the Flush method and it will wait until all the requests have been finished processing including the binded callbacks OnProcessRequestComplete. This is ideal for minimum amount of requests made.