From: miker Date: Wed, 9 Feb 2005 19:35:21 +0000 (+0000) Subject: adding subrequest example to Math.pm X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=381d10d1ef8bbd219ac8da40d9c158c1bc9735e7;p=opensrf%2Fbjwebb.git adding subrequest example to Math.pm git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@39 9efc2488-bf62-4759-914b-345cdb29e865 --- diff --git a/src/perlmods/OpenSRF/Application/Demo/Math.pm b/src/perlmods/OpenSRF/Application/Demo/Math.pm index 0faba6b..2f220c9 100644 --- a/src/perlmods/OpenSRF/Application/Demo/Math.pm +++ b/src/perlmods/OpenSRF/Application/Demo/Math.pm @@ -13,6 +13,8 @@ sub DESTROY{} our $log = 'OpenSRF::Utils::Logger'; sub send_request { + my $self = shift; + my $client = shift; my $method_name = shift; my @params = @_; @@ -71,12 +73,19 @@ sub send_request { } } +__PACKAGE__->register_method( method => 'send_request', api_name => '_send_request' ); __PACKAGE__->register_method( method => 'add_1', api_name => 'add' ); sub add_1 { my $self = shift; my $client = shift; my @args = @_; + + my $meth = $self->method_lookup('_send_request'); + my $result = $meth->run('add',@args); + + return $result; + return send_request( "add", @args ); } @@ -85,6 +94,12 @@ sub sub_1 { my $self = shift; my $client = shift; my @args = @_; + + my $meth = $self->method_lookup('_send_request'); + my $result = $meth->run('sub',@args); + + return $result; + return send_request( "sub", @args ); } @@ -93,6 +108,12 @@ sub mult_1 { my $self = shift; my $client = shift; my @args = @_; + + my $meth = $self->method_lookup('_send_request'); + my $result = $meth->run('mult',@args); + + return $result; + return send_request( "mult", @args ); } @@ -101,6 +122,12 @@ sub div_1 { my $self = shift; my $client = shift; my @args = @_; + + my $meth = $self->method_lookup('_send_request'); + my $result = $meth->run('div',@args); + + return $result; + return send_request( "div", @args ); }