-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: stream.push() after EOF #344
Comments
I'm unable to reproduce this. Can you add more context (browser, |
Its not being run 'in the browser' per say but rather via Google Apps Script which uses Chrome's V8 Javascript engine, so its functionally equivalent. I'm also using version 5.6.2 of avsc. After a lot of debugging and trial-and-error I was able to get the library to work by modifying the BlockEncoder.prototype._read = function () {
var self = this;
var data = this._queue.pop();
if (!data) {
if (this._finished && !this._pending) {
process.nextTick(function () {
self.push(null)
})
} else {
this._needPush = true
}
return
}
var state = this._readableState;
// add object count
this.push(LONG_TYPE.toBuffer(data.count, true));
state.ended = false;
// add size in bytes
this.push(LONG_TYPE.toBuffer(data.buf.length, true));
state.ended = false;
// add data/records
this.push(data.buf);
state.ended = false;
// add sync token
this.push(this._syncMarker);
if (!this._finished) {
data.cb()
}
}; I basically referenced the So in the context of Google App Script this works. But I'm not really comfortable with this as its basically a hack and I have yet to pinpoint the root of the issue (the nearest I got was the realization that Do you foresee any problems with this workaround? |
Setting |
Yup, If I recall correctly, the first push (which sets the object count) executes without error, but it sets up a state ( I used Google Apps Script's built-in debugger to trace the execution and I distinctly remember |
Built a standalone browser(javascript) distribution bundle from the
etc/browser
folder using the following browserify command:browserify --standalone avro avsc.js | uglify -o "dist/avsc.js"
Tested the
BlockEncoder
class using the function below:Ended up with the following error:
The text was updated successfully, but these errors were encountered: