pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

    1. <small id='YKHs0'></small><noframes id='YKHs0'>

        <bdo id='YKHs0'></bdo><ul id='YKHs0'></ul>
    2. <legend id='YKHs0'><style id='YKHs0'><dir id='YKHs0'><q id='YKHs0'></q></dir></style></legend>

      <tfoot id='YKHs0'></tfoot>

      <i id='YKHs0'><tr id='YKHs0'><dt id='YKHs0'><q id='YKHs0'><span id='YKHs0'><b id='YKHs0'><form id='YKHs0'><ins id='YKHs0'></ins><ul id='YKHs0'></ul><sub id='YKHs0'></sub></form><legend id='YKHs0'></legend><bdo id='YKHs0'><pre id='YKHs0'><center id='YKHs0'></center></pre></bdo></b><th id='YKHs0'></th></span></q></dt></tr></i><div class="zzvvrln" id='YKHs0'><tfoot id='YKHs0'></tfoot><dl id='YKHs0'><fieldset id='YKHs0'></fieldset></dl></div>

      Node.js 事件流:在哪里設(shè)置 MaxListeners?

      Node.js event-stream: Where to setMaxListeners?(Node.js 事件流:在哪里設(shè)置 MaxListeners?)

      <legend id='pZokz'><style id='pZokz'><dir id='pZokz'><q id='pZokz'></q></dir></style></legend>
          • <bdo id='pZokz'></bdo><ul id='pZokz'></ul>

                <tbody id='pZokz'></tbody>
                <tfoot id='pZokz'></tfoot>

                <small id='pZokz'></small><noframes id='pZokz'>

              1. <i id='pZokz'><tr id='pZokz'><dt id='pZokz'><q id='pZokz'><span id='pZokz'><b id='pZokz'><form id='pZokz'><ins id='pZokz'></ins><ul id='pZokz'></ul><sub id='pZokz'></sub></form><legend id='pZokz'></legend><bdo id='pZokz'><pre id='pZokz'><center id='pZokz'></center></pre></bdo></b><th id='pZokz'></th></span></q></dt></tr></i><div class="nzttxbl" id='pZokz'><tfoot id='pZokz'></tfoot><dl id='pZokz'><fieldset id='pZokz'></fieldset></dl></div>

                本文介紹了Node.js 事件流:在哪里設(shè)置 MaxListeners?的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                問(wèn)題描述

                限時(shí)送ChatGPT賬號(hào)..

                我已經(jīng)搜索并搜索了這個(gè),但無(wú)濟(jì)于事.我已經(jīng)梳理了網(wǎng)絡(luò)(包括 Stackoverflow)和 Node 文檔以尋找答案,但沒有找到一個(gè)有效的答案(也許這對(duì)我來(lái)說(shuō)只是不好的搜索).我正在處理 gulp 配置文件中的事件流,并且我有一個(gè)特定的任務(wù)正在從 EventEmitter 類中遇到經(jīng)典的檢測(cè)到內(nèi)存泄漏"錯(cuò)誤.根據(jù)我的發(fā)現(xiàn),處理這個(gè)問(wèn)題的答案似乎是調(diào)用 EventEmitter 類的 setMaxListeners 方法;我的研究表明事件流有一個(gè) Stream 對(duì)象,它應(yīng)該是 EventEmitter 的一個(gè)實(shí)例.但是,無(wú)論我嘗試調(diào)用 setMaxListeners 的方式,我都找不到方法.在精疲力盡地研究這個(gè)問(wèn)題之后,我想我會(huì)把它帶到這里的節(jié)點(diǎn)專家那里(我假設(shè)這很簡(jiǎn)單,我只是錯(cuò)過(guò)了一些東西).這是我的代碼:

                I have searched and searched for this, to no avail. I've combed the web (including Stackoverflow), and the Node docs for an answer, and not found one---that worked (maybe that's just bad searching on my part). I'm working with an event-stream in a gulp config file, and I have a particular task that is hitting the classic "memory leak detected" error from the EventEmitter class. From what I've found, the answer to dealing with this issue seems to be to call the setMaxListeners method of the EventEmitter class; and my research has suggested that the event-stream has a Stream object, which should be an instance of EventEmitter. However, what ever way I try to call setMaxListeners, I get method not found. After exhausting myself researching the issue, I figured I'd bring it to the Node gurus here (I'm assuming this is simple, and I'm just missing something). Here's my code:

                return eventStream.merge(
                        gulp.src('./jscript/libs/file-one.js'),
                        gulp.src('./jscript/libs/filder_one/file-two.js'),
                        gulp.src('./jscript/libs/folder_two/file-three.js'),
                        gulp.src('./jscript/libs/folder_three/file_four.js'),
                        gulp.src('./jscript/libs/folder_four/file_five.js'),
                        gulp.src('./jscript/libs/folder_five/file_six.js'), 
                        gulp.src('./jscript/libs/file_seven.js'),
                        gulp.src('./jscript/libs/file_eight.js'),
                        gulp.src('./jscript/lists/rules/*.js')
                    )        
                    .pipe(concat('my_file.js'))
                    .pipe(gulp.dest('./jscript/dist/'))
                    .pipe(rename('my_file.min.js'))
                    .pipe(uglify())
                    .pipe(gulp.dest('./jscript/dist/'));
                

                謝謝!

                推薦答案

                這不是您問(wèn)題的直接答案,但是您可以將 glob 模式數(shù)組傳遞給 'gulp.src()' 而不是合并多個(gè) 'gulp.src() 的.不解決你的問(wèn)題嗎?

                This is not a direct answer to your question, but you can pass an array of glob patterns to 'gulp.src()' instead of merging multiple 'gulp.src()'s. Doesn't it solve your problem?

                https://github.com/gulpjs/gulp/blob/master/docs/API.md#gulpsrcglobs-options

                編輯

                作為直接答案,以下內(nèi)容對(duì)我有用:

                As a direct answer, the following worked for me:

                var merged = eventStream.merge(...);
                merged.setMaxListeners(0);
                return merged.pipe(...);
                

                雖然在合并函數(shù)中添加了事件偵聽器,但似乎在事件循環(huán)的滴答聲之間檢查了偵聽器計(jì)數(shù).所以我們可以在添加監(jiān)聽器后立即設(shè)置MaxListeners.

                While event listeners are added in the merge function, the listener count seems to be checked between ticks of the event loop. So we can setMaxListeners right after adding listeners.

                這篇關(guān)于Node.js 事件流:在哪里設(shè)置 MaxListeners?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                相關(guān)文檔推薦

                Browserify, Babel 6, Gulp - Unexpected token on spread operator(Browserify,Babel 6,Gulp - 傳播運(yùn)算符上的意外令牌)
                Is it possible to pass a flag to Gulp to have it run tasks in different ways?(是否可以將標(biāo)志傳遞給 Gulp 以使其以不同的方式運(yùn)行任務(wù)?)
                Why do we need to install gulp globally and locally?(為什么我們需要在全局和本地安裝 gulp?)
                How to run Gulp tasks sequentially one after the other(如何一個(gè)接一個(gè)地依次運(yùn)行 Gulp 任務(wù))
                Visual Studio 2015 crashes when opening Javascript files(打開 Javascript 文件時(shí) Visual Studio 2015 崩潰)
                Detect FLASH plugin crashes(檢測(cè) FLASH 插件崩潰)
              2. <tfoot id='BHG4c'></tfoot>

              3. <i id='BHG4c'><tr id='BHG4c'><dt id='BHG4c'><q id='BHG4c'><span id='BHG4c'><b id='BHG4c'><form id='BHG4c'><ins id='BHG4c'></ins><ul id='BHG4c'></ul><sub id='BHG4c'></sub></form><legend id='BHG4c'></legend><bdo id='BHG4c'><pre id='BHG4c'><center id='BHG4c'></center></pre></bdo></b><th id='BHG4c'></th></span></q></dt></tr></i><div class="n7thvzz" id='BHG4c'><tfoot id='BHG4c'></tfoot><dl id='BHG4c'><fieldset id='BHG4c'></fieldset></dl></div>

                    <tbody id='BHG4c'></tbody>

                  <small id='BHG4c'></small><noframes id='BHG4c'>

                  1. <legend id='BHG4c'><style id='BHG4c'><dir id='BHG4c'><q id='BHG4c'></q></dir></style></legend>

                      • <bdo id='BHG4c'></bdo><ul id='BHG4c'></ul>
                        1. 主站蜘蛛池模板: 电动液压篮球架_圆管地埋式篮球架_移动平箱篮球架-强森体育 | 柴油发电机组_柴油发电机_发电机组价格-江苏凯晨电力设备有限公司 | 单级/双级旋片式真空泵厂家,2xz旋片真空泵-浙江台州求精真空泵有限公司 | 【星耀裂变】_企微SCRM_任务宝_视频号分销裂变_企业微信裂变增长_私域流量_裂变营销 | Brotu | 关注AI,Web3.0,VR/AR,GPT,元宇宙区块链数字产业 | 电动高尔夫球车|电动观光车|电动巡逻车|电动越野车厂家-绿友机械集团股份有限公司 | 酒店品牌设计-酒店vi设计-酒店标识设计【国际级】VI策划公司 | 河南中专学校|职高|技校招生-河南中职中专网 | 恒压供水控制柜|无负压|一体化泵站控制柜|PLC远程调试|MCGS触摸屏|自动控制方案-联致自控设备 | 桂林腻子粉_内墙外墙抗裂砂浆腻子粉推荐广西鑫达涂料厂家供应 | 平面钻,法兰钻,三维钻-山东兴田阳光智能装备股份有限公司 | 宁夏活性炭_防护活性炭_催化剂载体炭-宁夏恒辉活性炭有限公司 | 英国雷迪地下管线探测仪-雷迪RD8100管线仪-多功能数字听漏仪-北京迪瑞进创科技有限公司 | 购买舔盐、舔砖、矿物质盐压块机,鱼饵、鱼饲料压块机--请到杜甫机械 | 苏州防水公司_厂房屋面外墙防水_地下室卫生间防水堵漏-苏州伊诺尔防水工程有限公司 | 不锈钢监控杆_监控立杆厂家-廊坊耀星光电科技有限公司 | 折弯机-刨槽机-数控折弯机-数控刨槽机-数控折弯机厂家-深圳豐科机械有限公司 | uv固化机-丝印uv机-工业烤箱-五金蚀刻机-分拣输送机 - 保定市丰辉机械设备制造有限公司 | 带锯机|木工带锯机圆木推台锯|跑车带锯机|河北茂业机械制造有限公司| | 油漆辅料厂家_阴阳脚线_艺术漆厂家_内外墙涂料施工_乳胶漆专用防霉腻子粉_轻质粉刷石膏-魔法涂涂 | 安徽合肥项目申报咨询公司_安徽合肥高新企业项目申报_安徽省科技项目申报代理 | 天津市能谱科技有限公司-专业的红外光谱仪_红外测油仪_紫外测油仪_红外制样附件_傅里叶红外光谱技术生产服务厂商 | 仓储笼_仓储货架_南京货架_仓储货架厂家_南京货架价格低-南京一品仓储设备制造公司 | 杭州高温泵_热水泵_高温油泵|昆山奥兰克泵业制造有限公司 | 制氮设备_PSA制氮机_激光切割制氮机_氮气机生产厂家-苏州西斯气体设备有限公司 | 吲哚菁绿衍生物-酶底物法大肠菌群检测试剂-北京和信同通科技发展有限公司 | 精密钢管,冷拔精密无缝钢管,精密钢管厂,精密钢管制造厂家,精密钢管生产厂家,山东精密钢管厂家 | 小型单室真空包装机,食品单室真空包装机-百科 | 冷凝水循环试验箱-冷凝水试验箱-可编程高低温试验箱厂家-上海巨为(www.juweigroup.com) | 杭州标识标牌|文化墙|展厅|导视|户内外广告|发光字|灯箱|铭阳制作公司 - 杭州标识标牌|文化墙|展厅|导视|户内外广告|发光字|灯箱|铭阳制作公司 | 网架支座@球铰支座@钢结构支座@成品支座厂家@万向滑动支座_桥兴工程橡胶有限公司 | 水厂自动化-水厂控制系统-泵站自动化|控制系统-闸门自动化控制-济南华通中控科技有限公司 | 压滤机-洗沙泥浆处理-压泥机-山东创新华一环境工程有限公司 | 逗网红-抖音网红-快手网红-各大平台网红物品导航 | 江门流水线|江门工作台|江门市伟涛行工业设备有限公司 | 牛皮纸|牛卡纸|进口牛皮纸|食品级牛皮纸|牛皮纸厂家-伽立实业 | 火锅加盟_四川成都火锅店加盟_中国火锅连锁品牌十强_朝天门火锅【官网】 | 大型冰雕-景区冰雕展制作公司,3D创意设计源头厂家-[赛北冰雕] | 机制砂选粉机_砂石选粉机厂家-盐城市助成粉磨科技有限公司 | 冲击式破碎机-冲击式制砂机-移动碎石机厂家_青州市富康机械有限公司 | 蓄电池在线监测系统|SF6在线监控泄露报警系统-武汉中电通电力设备有限公司 |