Consume events from an event emitter in generators