How do I execute code on the Game thread from an FRunnable thread?

Hello, I have an FRunnable thread that is checking if data has been received on a few FSockets. Whenever specific data arrives from the sockets, I want to execute code on the game thread.

How can I execute code on the game thread from the FRunnable thread?

Thanks

Easiest way is to create your own queue of things to run on the game thread. Then poll that queue to execute the task when present. You can see an example in the Steam OSS

Ok that’s pretty easy. Is there any way to schedule something on the task graph from within my FRunnable such that I don’t have to poll the queue? I would like everything to be as automated as possible

You can’t safely access game thread data from another thread whether it’s a monolithic or task graph thread

Ok thanks for your answers