We should have a better way for transporting file data, a generic streaming interface that could work with all protocols - http / sockets etc.
Just some thoughts on file upload - we did abandon ddp for file upload on the collectionFS. Reason was heavy penalties in performance and overhead on connection etc. But socket streams should be just as fast as http? but possible safer.
I'm currently thinking it would be much cleaner to use streams instead of methods, maybe named streams so the server could handle different types of streams - instead of handling this in methods.
This would make it easier to stream data directly from FileReader on to the server.
Eg.
// Write the data
FileReader.createReadStream().pipe(Meteor.createWriteStream('files', params));
// Write streams can be defined on both client and server
// Eg. if the server wants to send data to the client.
Meteor.Streams({
'files': function(stream, params) {
// Maybe check this.userId?
// We would just write to the TempStore
if (stream.readable) {
readStream.pipe(fs.createWriteStream('/path/foo'));
} else {
return fs.createReadStream('/path/foo');
}
}
});
// Read the data
Meteor.createReadStream('files', params).pipe(myBlob.createWriteStream());List view
0 issues of 0 selected
There are no open issues in this milestone
Add issues to milestones to help organize your work for a particular release or project. Find and add issues with no milestones in this repo.