integrate events and nio