jimhigson / oboe.js

A streaming approach to JSON. Oboe.js speeds up web applications by providing parsed objects before the response completes.
http://jimhigson.github.io/oboe.js-website/index.html
Other
4.79k stars 209 forks source link

Question: can we add an option to change the buffer size in clarinet? #101

Open beyondcompute opened 8 years ago

beyondcompute commented 8 years ago

Hello! Thank you for your amazing remarkable job!

A little question here :) Sometimes I get this error:

{ statusCode: undefined,
  body: undefined,
  jsonBody: undefined,
  thrown: 
   [Error: Max buffer length exceeded: textNode
   Ln: 1
   Col: 2033738
   Chr: undefined] }

Can I fix it by increasing the value here: MAX_BUFFER_LENGTH = 64 * 1024 in clarinet.js?

If it is the case it would be good to have an option (environment variable, whatever) to change the buffer size for clarinet as I wouldn't want to diverge from the upstream. Thank you again and have a good week(end)!

mweimer commented 7 years ago

It would be nice if the buffer limit was configurable or you could optionally remove the buffer limit all together. I have some JSON with some pretty large strings that occasionally get split up across two chunks causing the textNode length to exceed the MAX_BUFFER_LENGTH.