Batch calls with Remoting

Posted on Friday 25 March 2005

This one really took me by surprise: if you call several methods through Remoting on the same frame, remoting will group all of the calls in a single Remoting call. That means, in particular, that if you call a remote method 100 times in the same frame, the remote server is called only once and only a single AMF object is received. At the AMF level, there is a int right after the headers for the number of bodys in this single AMF call. That clears up the mystery of BatchFilter in AMFPHP.

On return, Flash ’splits the response’ into several return calls, so this is all entirely transparent. The advantage of this method is obvious: the gateway is created only once instead of several times, only one packet is sent so it’s more efficient and the user needn’t worry about the details of the encoding. Which brings me to my point: if you want to do batch calls with Remoting, simply create a class called BatchCall that can store the calls in an array, add all of the calls you need over the course of several frames and then to send it just loop through the array and call the required methods. Flash will insure that the calls are sent through the network through a single AMF call.


WordPress database error: [Can't open file: 'wp_comments.MYD'. (errno: 145)]
SELECT * FROM wp_comments WHERE comment_post_ID = '63' AND comment_approved = '1' ORDER BY comment_date

No comments have been added to this post yet.

Leave a comment




Your e-mail address is never displayed. If you run into issues with SpamKarma blocking you, email me at $patrick->5etdemi(com)


RSS feed for comments on this post | TrackBack URI