Disclaimer: I asked this question on Nakama’s gitter channel and it already have a valid answer, but I’m posting it here just in case other developers find this helpful.
Due to the fact that Socket.ReceiveLoop() is an async func, all the event handlers subscribed to socket events are handled in async context (correct me if I’m mistaken, please). That really limits the functionality in Unity, because now I cannot have a handler to, for example, set a component
enabled property to true/false, because Unity mandates to do such a thing on the main thread and throws error if it’s done in a normal (not async) handler subscribed to socket events.
what is the cleanest, most elegant way to bypass such limitations??