EventEmitter using generators