Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign up[CLOSED] Implement File.createReadableStream #108
Comments
This comment has been minimized.
This comment has been minimized.
|
To make my proposal above more concrete, here is a preview of the changes I'm suggesting to Storage (untested):
Webtorrent would then contain a FSStorage subclass which just overrides _init. |
This comment has been minimized.
This comment has been minimized.
|
The browserify fs situation will be interesting to solve. What implementations have you looked at? |
This comment has been minimized.
This comment has been minimized.
|
https://www.npmjs.org/package/browserify-fs seems to be the frontrunner, but it depends on level.js which is currently only supported on chrome and opera. https://github.com/js-platform/filer also seems like a working solution, though again I'd be hesitant to add a dependency that seems so immature before the browserify community has chosen a direction. |
This comment has been minimized.
This comment has been minimized.
|
This should probably be closed; if we want to support browser-compatible disk backed storage, it deserves its own issue. |
Wednesday May 14, 2014 at 08:53 GMT
Originally opened as https://github.com/feross/bittorrent-client/issues/12
Aiming to use torrent_stream's implementation as a starting point.
@feross I've already started delving into this, and it's not hard with Storage containing a flat Buffer of all the data, but I really think Storage needs to be mostly redone to support asynchronous writes/reads ala torrent_stream for when Storage is backed by a set of files and not a huge Buffer.
In a perfect world, we could use one implementation that utilized browserify-fs, but AFAIK there is no node fs replacement with solid cross-browser support yet :(
My current plan is to refactor Storage to have an async interface with a synchronous default implementation similar to what exists currently and then use a subclass of Storage in the webtorrent repo that's implemented on top of fs so bittorrent-client will remain compatible with browserify, but I'd really like input here since this is a heftier design change.