]> git.evergreen-ils.org Git - OpenSRF.git/commit
Add response chunking support to the Perl implementation of OpenSRF
authormiker <miker@9efc2488-bf62-4759-914b-345cdb29e865>
Thu, 29 Jul 2010 17:40:03 +0000 (17:40 +0000)
committermiker <miker@9efc2488-bf62-4759-914b-345cdb29e865>
Thu, 29 Jul 2010 17:40:03 +0000 (17:40 +0000)
commitf469ca73214b0076db2ceaf04a4e0f7a29d50b83
treea441815a220a523f26b833b6ca2e394e9cb07c94
parentf1ee578b506d67c6c0105f9510344aec50f3adfb
Add response chunking support to the Perl implementation of OpenSRF

Two new optional paramters to register_method are now supported:
 * max_chunk_size
 * max_chunk_count

OpenSRF has always supported message bundling, but only respond_complete made
use of this fact by sending the final result message and the completion status
message in the same XMPP envelope.  Now, on a per method basis, RESULT messages
can be bundled (cached) until one of three conditions occurs:

 * The size of the JSON of the RESULT messages matches or exceeds max_chunk_size
 * The number of RESULT messages cached matches or exceeds max_chunk_count
 * respond_complete is called (which happens implicitly by returning from a method)

Because the overhead of sending multiple XMPP messages far outweighs the caching
and cache management costs of chunking, the default for max_chunk_size is set
at 10240 bytes (10k).  The default for max_chunk_count is 0.  To turn off chunking
completely, set the max_chunk_size register_method parameter to 0.

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1985 9efc2488-bf62-4759-914b-345cdb29e865
src/perl/lib/OpenSRF/AppSession.pm
src/perl/lib/OpenSRF/Application.pm