]> git.evergreen-ils.org Git - working/OpenSRF.git/commit
LP#1631522: Dispatch mode for method_lookup subrequests
authorMike Rylander <mrylander@gmail.com>
Thu, 25 Aug 2016 21:42:31 +0000 (17:42 -0400)
committerGalen Charlton <gmc@esilibrary.com>
Tue, 1 Nov 2016 21:14:02 +0000 (17:14 -0400)
commit9d106aef9ab0a8d5af75977ffb4cc5f8f3fe5c79
tree5a07081a010848c5103a076e4396f0b72dcde32e
parentdbf9ec150dfa6a5b87028aa890a80b529dfe5683
LP#1631522: Dispatch mode for method_lookup subrequests

There is a pattern in the wild of using OpenSRF's method_lookup() facility
to decide between one of several local methods when delegating to pre-existing
logic.  Often times, we want to simply hand control over to another method,
but the output of a subrequest's run() is an array of results.  The caller has
to know if, and how, to restructure the result for the client.

Instead, we can now call dispatch() instead of run() and have OpenSRF session
control completely passed to the delegate code.  This way, the delegate code
need not know anything about its caller, and vice versa.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
src/perl/lib/OpenSRF/AppSession.pm
src/perl/lib/OpenSRF/Application.pm