I have a C++ application with an embedded V8 engine and I want to use V8 to transform data flexibly using Javascript. The amount of data is potentially large and comes from different file formats, so it is processed one record at a time. How can I make the data available to V8 one record at a time?
The 2 options that I'm thinking about would be making the C++ record stream available via Accessors as javascript objects - but I don't know how to return an ArrayBuffer from a C++ object.
The other option that I was thinking about was creating with each new record a new ArrayBuffer using the v8-API and binding it to the same global variable - so that the scripts can access it.
What would be the best / most performant way to stream the data in / out?