event-stream

node heap exhausted when piping JSONStream.parsed() data through es.map() and JSONStream.stringify() to file stream

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-14 02:05:49
问题 I'm trying to pipe an input stream (created from a huge GeoJSON file) through JSONStream.parse() to break the stream into objects, then through event-stream.map() to allow me to transform the object, then through JSONStream.stringify() to create a string out of it, and finally to a writable output stream. As the process runs, I can see node's memory footprint continue to grow until it eventually exhausts heap. Here's the simplest script (test.js) that recreates the problem: const fs = require

Server sent event EventStream does not trigger “onmessage” but Chrome Debug shows data in “EventStream” tab

只愿长相守 提交于 2019-12-05 10:46:46
问题 I'm using SSE with the EventStream built in logic for javascript. While having onopen return a successful result the onmessage callback is not working. Odd thing here is that within Chrome in the EventStream tab the data results are listed as I expect them. This is my JS snippet for the EventSource var eventSource; $(function () { eventSource = new EventSource('get/status/'); eventSource.onopen = function () { console.log("Sse connection opened"); }; eventSource.onerror = function () {

Server sent event EventStream does not trigger “onmessage” but Chrome Debug shows data in “EventStream” tab

老子叫甜甜 提交于 2019-12-04 00:32:39
I'm using SSE with the EventStream built in logic for javascript. While having onopen return a successful result the onmessage callback is not working. Odd thing here is that within Chrome in the EventStream tab the data results are listed as I expect them. This is my JS snippet for the EventSource var eventSource; $(function () { eventSource = new EventSource('get/status/'); eventSource.onopen = function () { console.log("Sse connection opened"); }; eventSource.onerror = function () { console.log("error occured"); }; eventSource.onmessage = function (event) { console.log("received"); }; });

ActionController::Live Is it possible to check if connection is still alive?

删除回忆录丶 提交于 2019-12-03 04:23:31
问题 I'm trying to implement text/event-stream using Rails 4's Live streaming. It works great and the only trouble I met is that I can't check if the connection is alive without sending any messages. The only solution I figured out is to make supportive channel with cyclic tick generator, so that some background task will send messages there periodically. But it seems to be messy and non-reliable. Any better solutions? Here is my controller: require 'persistency/sse' require 'persistency/track'

Gulp.js event stream merge order

扶醉桌前 提交于 2019-12-02 16:15:46
I am trying to merge css and scss files into a main.css file that goes in my build directory. Its working, but not in the right order. The style attributes from the scss files need to be in the bottom of the main.css file so they overrule the rest. my Gulp task looks like this: //CSS gulp.task('css', function () { var cssTomincss = gulp.src(['dev/css/reset.css', 'dev/css/style.css','dev/css/typography.css', 'dev/css/sizes.css']); var cssFromscss = gulp.src(['dev/css/*.scss']) .pipe(sass()); return es.merge(cssTomincss, cssFromscss) .pipe(concat('main.css')) .pipe(minifyCSS()) .pipe(gulp.dest(

Node.js event-stream: Where to setMaxListeners?

ⅰ亾dé卋堺 提交于 2019-12-02 04:39:12
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

How to stream data over socket.io to client

邮差的信 提交于 2019-11-28 06:38:45
问题 I have socket.io sending a basic object from server to client. This bit works fine. Now want to send a stream from server to client, using event-stream (specifically the results of a block-chain query). I am getting unexpected results in the browser console.. var io = require('socket.io')(server); var dsteem = require('dsteem') var es = require('event-stream') var util = require('util') var client = new dsteem.Client('https://api.steemit.com') var stream = client.blockchain.getBlockStream() /