Cross-platform event loop for web servers