From 0bc13eec09d42d3a7a9cddb6406929e172ac47f8 Mon Sep 17 00:00:00 2001 From: erickson Date: Wed, 16 Mar 2005 02:37:14 +0000 Subject: [PATCH] moved back to non-method_lookup method to test 'original' speed git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@237 9efc2488-bf62-4759-914b-345cdb29e865 --- src/perlmods/OpenSRF/Application/Demo/Math.pm | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/perlmods/OpenSRF/Application/Demo/Math.pm b/src/perlmods/OpenSRF/Application/Demo/Math.pm index d217461..eed993a 100644 --- a/src/perlmods/OpenSRF/Application/Demo/Math.pm +++ b/src/perlmods/OpenSRF/Application/Demo/Math.pm @@ -19,17 +19,15 @@ sub send_request { my $method_name = shift; my @params = @_; - - my $method = $self->method_lookup( "dbmath.$method_name" ); - my ($resp) = $method->run( @params ); + my $session = OpenSRF::AppSession->create( "opensrf.dbmath" ); + my $request = $session->request( "dbmath.$method_name", @params ); + my $response = $request->recv(); + if(!$response) { return undef; } + if($response->isa("Error")) {throw $response ($response->stringify);} + $session->finish(); - if(!defined($resp)) { - throw OpenSRF::EX::ERROR ("Did not receive expected data from MathDB\n" . $resp); - } - - $log->debug( "MathDB server returned " . $resp, INTERNAL ); - return $resp; + return $response->content; } __PACKAGE__->register_method( method => 'send_request', api_name => '_send_request' ); -- 2.11.0