Idea: in addition to RPC function calls implement inter-isolate object streams. Useful to implement proper data flow between applications with less overhead than function calls.
Maybe something like this:
Isolate 1
// create stream with 10 object slots
var stream = isolate.createStream({size: 10});
// .. pass stream to other isolate as regular object
// push can throw if stream buffer is full
// when receiver is unable to process data that fast
// so there is a check
if (stream.canPush()) {
stream.push({a: 'value'});
}
Isolate 2
// read available data from stream buffer (once)
var maxCount = 10; // 0 = all elements
stream.pull(maxCount, function(type, dataArray) { ... })
// or
stream.pull(maxCount).then(function(type, dataArray) { ... })
Type variable one of { 'data', 'error', 'end' }. In case of error dataArray variable contains error object.
When Isolate 2 is ready to receive more data it can call stream.pull() again.
Idea: in addition to RPC function calls implement inter-isolate object streams. Useful to implement proper data flow between applications with less overhead than function calls.
Maybe something like this:
Isolate 1
Isolate 2
Type variable one of { 'data', 'error', 'end' }. In case of error
dataArray
variable contains error object. When Isolate 2 is ready to receive more data it can callstream.pull()
again.