filer.js icon indicating copy to clipboard operation
filer.js copied to clipboard

Usable in Web Workers

Open ebidel opened this issue 14 years ago • 4 comments

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

ebidel avatar Dec 27 '11 21:12 ebidel

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.

ebidel avatar Mar 29 '12 21:03 ebidel

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!

mwise avatar Jan 08 '14 01:01 mwise

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.

ebidel avatar Jan 08 '14 02:01 ebidel

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.

mwise avatar Jan 08 '14 02:01 mwise