moved back to non-method_lookup method to test 'original' speed
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Wed, 16 Mar 2005 02:37:14 +0000 (02:37 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Wed, 16 Mar 2005 02:37:14 +0000 (02:37 +0000)
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@237 9efc2488-bf62-4759-914b-345cdb29e865

src/perlmods/OpenSRF/Application/Demo/Math.pm

index d217461..eed993a 100644 (file)
@@ -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' );