Skip to content
This repository was archived by the owner on Mar 14, 2019. It is now read-only.
Open
Overdue by 11 year(s)
Due by June 19, 2014
Last updated Mar 27, 2014
0% complete

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

    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.