This is just a very hacky example of how to poll ENet in a job, by no means is this an actual pull request which should be merged!
The main event loop:
Create and schedule a job
Next frame wait for the job (it should already be finished) and then consume the ENet events it received.
Schedule another job
Actual processing of the ENet events isn't moved into a background thread, obviously you'd want to move as much of that into a job as possible in practice.
There's some other unrelated stuff, mostly just spring cleaning as I was looking around the codebase. better namespacing, moving ChannelType out to a separate file, ToENetPacketFlag extension etc. You can pretty much ignore all that.
This is just a very hacky example of how to poll ENet in a job, by no means is this an actual pull request which should be merged!
The main event loop:
Actual processing of the ENet events isn't moved into a background thread, obviously you'd want to move as much of that into a job as possible in practice.
There's some other unrelated stuff, mostly just spring cleaning as I was looking around the codebase. better namespacing, moving ChannelType out to a separate file,
ToENetPacketFlag
extension etc. You can pretty much ignore all that.