event loop interface implementation based on select