I'm trying to build a client/server app based on the Cap’n Proto RPC in Rust. Looking at the calculator example code, the RPC wants to shove everything into a single round-trip call. That's awesome, but how will that behave when the data to send is on the order of gigabytes? Will the library try to keep it all in memory or will it realize at some point that's too much?
Note: I don't have any code to show yet, but my ideal client pseudocode would be:
job = new_job(...) // rpc call
for f in (millions...) {
file = job.new_file(f) // rpc call
for data in f.chunks(thousands...) {
file.process_chunk(data) // rpc call
}
}
How would I structure my client code? Do I have to force a flush at some point (and from the look of it, read some dummy data from the server)?
So far the server seems straightforward, just handling files and chunks as they come, but if there are any gotchas in there, I'm all ears as well.