Oh, I wrote that from memory, looks like actually the workerfs usage needs
to access the blob at mount time. Here is an example that does it:
https://github.com/kripken/emscripten/blob/master/tests/fs/test_workerfs_package.cpp#L73
but the example usage doesn't interact with IndexedDB, looks like that kind
of path does not exist. That example does an XHR as a blob and then mounts
that blob into WORKERFS.

What you describe sounds ok. Btw, you may want to keep an eye out for the
emscripten_fetch() API and ASMFS. Those should help with these types of use
cases. (See the emscripten_fetch() thread on this mailing list)

2016-09-14 13:58 GMT+03:00 'Andras Kucsma' via emscripten-discuss <
emscripten-discuss@googlegroups.com>:

> Jukka, can you clarify where workerfs accesses IndexedDB? I can't find it.
>
> Our plan is to send XHRs with blob responseType and store them in workerfs.
>
> Based on the workerfs code, it seems to be ok to call WORKERFS.createNode
> dynamically. Maybe existing files and directory management would need some
> extra work.
>
> Do you see anything wrong with this approach (assuming workerfs is
> extended to handle this appropriately)?
>
> Thanks,
> András
>
> On Tue, Sep 13, 2016 at 8:57 PM, Jukka Jylänki <juj...@gmail.com> wrote:
>
>> It would be possible to add and remove files from WorkerFS, but both of
>> those operations will require accessing IndexedDB, so neither of them will
>> be synchronous operations. The deletion could be done in a fire and forget
>> manner if one just assumes up front that the operation will always succeed.
>> The addition could also be done in this manner, pretending that the async
>> IndexedDB store will succeed, and assuming that the data for that file
>> comes from a synchronous source and not based on an async XHR. Like you
>> noted in 2. it is likely that bits are unimplemented so far, so this gets
>> you to experimentation land.
>>
>> 2016-09-13 20:12 GMT+03:00 Alon Zakai <alonza...@gmail.com>:
>>
>>> I'm actually not sure, been a while since anyone worked on that code. I
>>> remember the focus back then was just to see how useful sync reading (using
>>> FileReaderSync, which is worker-only) is. Maybe the best thing is to just
>>> try and see, the size of library_workerfs.js is fairly small so should be
>>> easy to get into. FWIW my guess is adding new files/blobs could be possible.
>>>
>>> On Mon, Sep 12, 2016 at 9:50 AM, 'Andras Kucsma' via emscripten-discuss
>>> <emscripten-discuss@googlegroups.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> I have a couple of questions about the WORKERFS implementation:
>>>>
>>>>    1. Is it possible to add new files to the WORKERFS after mounting?
>>>>    (The documentation
>>>>    
>>>> <https://kripken.github.io/emscripten-site/docs/api_reference/Filesystem-API.html#id2>
>>>>    suggests that only mount time, static file lists are supported, but it's
>>>>    not explicitly stated)
>>>>    Maybe I can call WORKERFS.createNode directly?
>>>>
>>>>    2. Lot of FS functions are not implemented in WORKERFS
>>>>    
>>>> <https://github.com/kripken/emscripten/blob/c1e7ac6a5f4f38668a13b037747417e3ccbebf56/src/library_workerfs.js#L96-L119>
>>>>    .
>>>>    I'm particularly interested in is removing files (unlink). Is there
>>>>    any fundamental difficulty with doing that, or just simply no one got
>>>>    around to implement it yet?
>>>>
>>>> Thanks,
>>>> András
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "emscripten-discuss" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to emscripten-discuss+unsubscr...@googlegroups.com.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "emscripten-discuss" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to emscripten-discuss+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "emscripten-discuss" group.
>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>> pic/emscripten-discuss/_gMBtDImb2Y/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> emscripten-discuss+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "emscripten-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to emscripten-discuss+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to emscripten-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to