Skip to content

Lazy loading #167

Open
Open
@nickasd

Description

@nickasd

In #145 I discussed the possibility of implementing a filesystem. What I'm wondering now is how I could support lazy loading, i.e. build a collection where each document contains only the filename at the beginning and, when a file's contents are requested, they would be read from disk and stored in the corresponding document.
I tried sharedb.use('receive', callback) to intercept all requests to the database, and inside the callback doc.fetch(...) and doc.submitOp(...) to populate the missing data, but the callback is called for each of these two calls. How can I distinguish if the callback is called because it was triggered by a client or the server? Is there a more convenient way to do this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions