ebidel / filer.js

A wrapper library for the HTML5 Filesystem API what reuses UNIX commands (cp, mv, ls) for its API.
Other
1.49k stars 155 forks source link

Usable in Web Workers #4

Open ebidel opened 12 years ago

ebidel commented 12 years ago

I believe the lib can be used, but making it more friendly for workers might be worthwhile. There's a synchronous API.

ebidel commented 12 years ago

Also, I don't believe webkitStorageInfo is available in a worker, so there's no way to request quota for the first time when using persistent storage.

mwise commented 10 years ago

Hey Eric,

Have you done any more digging on using filer.js in a web worker context? We're using filer.js to store audio samples and are always looking for opportunities to pull things out of the main process. I see that this is is an old issue, so I figured I'd reach out to you before looking into it too deeply. If you have any new insights or recommendations, I'd be happy to dig into this approach a bit.

--oops, just saw your 'Dealing with Quota' section on http://www.html5rocks.com/en/tutorials/file/filesystem-sync/ . Would this approach be something you'd think about rolling into filer.js? If so and we can get it working, I can take a stab at putting together a PR for it.

This library and your articles on Filesystem API are great - thanks for putting them out there!

ebidel commented 10 years ago

Unfortunately I haven't. I believe things should, but haven't spent the time to properly test. The one issue (noted above) is that you'd have to do quota checks outside of the worker...unless that API was added recently.

If filer.js doesn't work out of the box, I'd imagine only a few small tweaks would be required.

mwise commented 10 years ago

Ok awesome, thanks. I just realized that this issue was probably referring to filer.js being imported wholesale into a worker, so I'm not sure that extending it to make the quota call outside the worker will fit in the library's scope. Thanks for the quick reply - I'll report back if I find anything interesting.