Regarding batch request to server vs multiple concurrent XHR calls: In theory, the single batch request could have its individual items carried out simultaneously (in separate threads) by the server once it has received the batch.
In practice for PHP, this is unlikely to happen - but it seems wrong to simulate threading in PHP by initialising concurrent threads from the Javascript client! The API reference says the server has the freedom to carry out the requests in any order (or concurrently) provided it will not affect the results (compared to running them strictly in order). Thinking about it, the concurrent XHR request system is dangerous. Imagine the client submits two requests in one batch: first request to update one person's app data, and second request to fetch the app data. If the second request happens to arrive first (or even if the first request just happens to take a long time to perform), the fetch will return different results. Kevin - agreed that we need to standardise the internal Javascript and message format. In fact, I've been saying that ideally the Javascript would talk back to the server in the same 'language' as the Data APIs... That might be running ahead of ourselves for now, though. Dan -----Original Message----- From: Vincent Demay [mailto:[EMAIL PROTECTED] Sent: 18 February 2008 09:12 To: [email protected] Subject: Re: Are you interrested in an OpenSocial feature using xhr? Le 17 févr. 08 à 23:20, Dan Lester a écrit : > > I am currently trying to do the same thing - on the Javascript side, > anyway. Thanks for your code as I'm sure it will help me. > > I think it is important to write versions of the server-side > components > in PHP as well as Java - probably more important than porting the rest > of the gadget server to PHP, really, since this part needs to connect > directly to the rest of the container social network. The rest of the > gadget server can be run as the Java version for now. I think so. in this case javasript-xhr to server side communication should be defined/standardized first. > > > Once comment on the patch though is that (I think) you are making GET > requests one-at-a-time to the 'respond' servlet. Why not send a single > batch as a POST request, to have them all returned in one go? That's > what I'm trying, anyway, so let me know if I'm forgetting an obvious > problem... Hi Dan, I thought about making a single batch request but some parts can be called separatly (ie UPDATE_PERSON_APP_DATA). And if I well understood OpenSocial Spec, user can call a req.send() anywhere in his code, so separate requests was easier to implement ;) . guys, wdyt? Do you think it's better a to do a single request by req.send()(less network traffic) or separate each req.newFetch* in a request? > > > Thanks, > > Dan > > > -----Original Message----- > From: Vincent Demay [mailto:[EMAIL PROTECTED] > Sent: 17 February 2008 17:22 > To: [email protected] > Subject: Re: Are you interrested in an OpenSocial feature using xhr? > > > Hi, > > Oki, I've just attached a patch in SHINDIG-77. Let me know if you need > more stuff to run it or if you get some troubles. > > Cassie, I'm very curious to see what you did, let me know, what you > think about mine ;) > > Thanks > > Cheers > > -- > Vincent > > > Le 17 févr. 08 à 05:05, Cassie a écrit : > >> Vincent - >> I am also working on this right now. I should be committing a very >> very basic version soon but I would love to see what you have. >> Perhaps I can >> improve my code with your changes (or scrap mine altogether). >> >> Either way, I think it will be a very long term project that can grow >> more sophisticated over time. Like Kevin said, it would be great to >> see a patch! >> Thanks! >> >> - Cassie >> >> >> On Sat, Feb 16, 2008 at 1:06 PM, Kevin Brown <[EMAIL PROTECTED]> wrote: >> >>> If you've got something you'd like to contribute to the project, >>> your best bet is to send a patch. This makes it easy to try out the >>> changes and see >>> if >>> it's a contribution that makes sense for the project. If patching >>> would be >>> difficult, just send a zip file with the files. >>> >>> On Feb 16, 2008 8:04 AM, Vincent Demay <[EMAIL PROTECTED]> wrote: >>> >>>> Hi all >>>> >>>> I'm currently writing a feature (based on container-sample) >>>> implementing openSocial API querying data from a new Servlet >>>> responding json to xhr >>>> request instead of using a static XML file. >>>> >>>> It will probably be the base for our openSocial compliance on our >>>> project (http://www.goojet.com). >>>> >>>> It's currently hable to manage people and friends API and >>>> Persistence Data Api but not yet activities. >>>> >>>> For now it is just a very begginning but, if you are interrested in >>>> a such stuff (feature + servlet with a mock giving data), just let >>>> me know, because we are ready to share it to shindig and to take >>>> into account your remarks ;). >>>> >>>> Cheers, >>>> >>>> PS : Of course if you are developing a such feature I'm very >>>> interrested in, and I will be happy to contribute. >>>> >>>> -- >>>> Vincent Demay >>>> >>>> >>> >>> >>> -- >>> ~Kevin >>> >>> If you received this email by mistake, please delete it, cancel your >>> mail account, destroy your hard drive, silence any witnesses, and >>> burn down the >>> building that you're in. >>> > > >

