While working on twederation I have been making widgets that will let you incorporate google sheets into tiddlywiki using xmlhttprequests to store and retrieve data. What the widget does now is spawn a web worker in the background to make the request and parameters are passed to the worker via postMessage, then when the worker gets a response it sends the retrieved data to a listener via postMessage and the widget does whatever manipulation you want with it. Currently in my demo it just prints the output in the console, but it is a json object in the code so it is available.
For now a new worker is spawned whenever a request is made and after sending the response back to the calling widget the worker terminates itself. I am not sure if this is the best way to do this. Would it be better to create one persistent worker that all widgets that send messages share or is it better for each widget to create a new self-terminating worker each time they make an xmlhttprequest? The current demo is here http://ooktech.com/jed/ExampleWikis/TWederation/WebWorkerTest/, it doesn't do much past a proof of concept yet. Currently the interesting code is in the tiddlers $:/plugins/inmysocks/TWederation/action-requestdata.js and $:/plugins/inmysocks/TWederation/action-submitform.js I believe this is how the plugin library interactions should be handled since it works without stopping the main wiki waiting on a response, but we need to add some notification that the working being active. A notification shouldn't be hard to make, that is more of a note for future jed. -- 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/03f341df-9c2b-4694-96b8-275db5039cea%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
