Closed john-bv closed 2 years ago
This approach is quite simple and straight to the point. We would pass the raknet instance directly into the function to allow the instance to outlive the threads.
How this might look:
pub fn start(server: &mut RakNetServer, event_cb: dyn FnMut(RakNetEvent) -> Option<RakResult> + Send + Sync) -> JoinHandles {
// This should allow us to mutate the server inside the event callback using crossbeam.
// spawn threads...
}
Here I will be discussing possible solutions on a discussion with this issue linked. For more information on why this is an issue, reference this issue.