Hi guys,

recently I've understood that the "slow saving" of big TiddlyWikis 
(Classic, in my case) is due to the synchronous nature of saving which 
makes the interface to hang while the saving is done. So I've tried 
implementing async saving with MicroTiddlyServer (current dev snapshot 
attached) and was very satisfied with the result. For now, I can't use MTS 
with all my TWs because of couple of reasons and it's not that popular 
anyway, so I'm curious if it's possible to make TiddlyFox async. I've tried 
some silly tricks like setTimeout("mozillaSaveFile(...)" but haven't 
succeeded. Looking at the code, I guess that can't work that way since 
mozillaSaveFile does stuff with DOM which can't be async:

function (path,content) {
    // Find the message box element
    var messageBox = document.getElementById("tiddlyfox-message-box");
    if(messageBox) {
        // Create the message element and put it in the message box
        var message = document.createElement("div");
        message.setAttribute("data-tiddlyfox-path",path);
        message.setAttribute("data-tiddlyfox-content",content);
        messageBox.appendChild(message);
        // Create and dispatch the custom event to the extension
        var event = document.createEvent("Events");
        event.initEvent("tiddlyfox-save-file",true,false);
        message.dispatchEvent(event);
    }
    return true;
}

As I'm not familiar with the internals of TiddlyFox, I wonder if this can 
be remade async (which would be very nice!) There's one thing to be aware 
of, though: 2 saving requests shouldn't go with a little delay -- or TF 
should prevent possible read/write [of same file] conflicts.

Best regards,
Yakov.

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/db600370-3062-4dc3-8454-e489b07810d7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

<<attachment: MicroTiddlyServer_(YLv1.4.3__).php>>

Reply via email to