Download

Async Tasks Based Off Async Events.

Hola,
I’m trying to run a set of async tasks after another set of async tasks finishes, but I’m running into some issues with how best to do that.

All of my operations function essentially like HTTPRequests function in the engine. Call some function and wait for a callback delegate to be fired. I want to essentially fire off a handful of them, wait for them all to complete, then fire off a couple more, followed by some completed event.

I was looking at the task graph system (mostly FBaseGraphTask and FCompletionList), which seems to almost do what I want, but it has a couple issues with what I’d be using it for. The task graph seems to be used primarily for running synchronous bits of code asynchronously (ie. runs ExecuteTask once and then destroys itself, which marks it as complete and it moves on). I’m wondering if there’s a safe way to insert async event based functionality into the task graph. My naive idea is to call the async call from the ExecuteTask function (HttpRequest::ProcessRequest), then in the on complete delegates (HttpRequest::OnProcessRequestComplete) destroy the task. I have no idea if this will work or if it’s safe though.

Just wondering if anybody has any ideas on this. I could brute force it down and just manually check that ever step has been completed, but I really like the idea of an flexible easy to modify task based solution if dependencies and jazz change. I’m just dipping my toes into unreal’s async stuff, so I’m open to any pointers at all.

Lemme know! Thanks much!