maxEventNum may be set to 0 to process all events