Batching roundtrips?

7 views
Skip to first unread message

Matt Hooper

unread,
Jul 23, 2012, 3:37:34 PM7/23/12
to exos...@googlegroups.com

Is it possible, and does it even make sense, to batch together multiple round trips into a single one?  We have a situation where a property is being set twice followed by a manual roundtrip() call each which triggers a roundtrip.  Could these requests all be queued with a window.timeout() and only a single roundtrip occur?  Would there be any negative consequences to doing that?

 

Thanks,

Matt

 

Bryan Matthews

unread,
Jul 24, 2012, 10:36:19 AM7/24/12
to exos...@googlegroups.com
Yes it's possible, and I think it makes a lot of sense.  I started specing it out a while back but we were able to come up with a simpler solution to the problem at that time.  The request/response format is generic enough that it should support it already.  It would likely require a few significant changes to the way we handle sending and responding to requests from the client, and the way the providers are structured.

As far as how the batching actually happens, the requests could probably be cleanly batched via event scopes.  Using this approach a roundtrip triggered by framework events (i.e. rules, property changes due to the user editing a field in the UI, etc.) would be batched automatically.  If a roundtrip or event was manually triggered due to a DOM event (i.e. user clicking a button) then batching wouldn't automatically happen.  However, in that scenario if the developer needed to raise multiple events or roundtrip multiple objects then the API could support that as well.  If that doesn't take care of every scenario we could possibly detect an event being called in exceptional circumstances and fall back to timeouts in that case.
Reply all
Reply to author
Forward
0 new messages