如何正确closuresmeteorstream?
我正在使用一个stream,closures它后我有一个错误:
events.js:141 throw er; // Unhandled 'error' event ^ Error: write after end at writeAfterEnd (_stream_writable.js:166:12) ...
stream是这样创build的:
logStream = Object.create(null); function containerLogs(idContainer, from) { logStream[idContainer] = new stream.PassThrough();
然后我在网上find一个closures它的方法是:
logStream[data.idContainer].end('!stop!');
但它会产生上面的错误,尽pipe它看起来像closuresstream。 我有点失落,如果有人能再次让我走上赛道,我会很感激
[编辑]这里是使用stream的function:
function containerLogs(idContainer, from) { logStream[idContainer] = new stream.PassThrough(); logStream[idContainer].setEncoding('utf8'); logStream[idContainer].on('data', function(chunk){ console.log("you are receiving logs from: " + idContainer); try { Streamy.emit('resultLogs', { result: chunk.toString() },from); } catch (e) { console.log("error from on data"); } }); docker.getContainer(idContainer).logs({ follow: true, tail: 5, stdout: true, stderr: true }, function(err, stream){ if(err) { return logger.error(err.message); } docker.getContainer(idContainer).modem.demuxStream(stream, logStream[idContainer], logStream[idContainer]); }); }
- Docker私人注册使用自签名证书
- 更新导致孤儿图像的docker图像
- 在同一主机上的Windows和Linux泊坞窗容器之间进行通信
- .NET核心getstringasync在Docker中不起作用
- Kubernetes VS Docker Swarm
- python TypeError:必须是没有NULL字节的编码string,而不是str – docker iron requirements.txt
- Docker不会将数据保存在主机安装的卷中
- 相同的docker图像适用于Windows的Docker,但不适用于Linux上的docker
- 如何在具有桥接模式的docker容器中运行Apache Spark 2.1驱动程序