Move yunq to new thread spawn and remove old one.

This commit is contained in:
Drew Galbraith 2025-01-26 00:05:55 -08:00
parent 79e1ea2791
commit d777b8f4ab
7 changed files with 33 additions and 76 deletions

View file

@ -369,17 +369,6 @@ fn generate_server(interface: &Interface) -> TokenStream {
handler,
})
}
pub fn run_server(&self) -> Result<Box<thread::Thread>, ZError> {
let thread_entry = |server_ptr: *const c_void| {
let server = unsafe { (server_ptr as *mut #server_name<T>).as_mut().expect("Failed to convert to server") };
server.server_loop();
};
thread::Thread::spawn(
thread_entry,
self as *const Self as *const core::ffi::c_void,
)
}
}
impl<T: #server_trait> yunq::server::YunqServer for #server_name<T> {