From: erickson Date: Mon, 29 Nov 2010 19:17:37 +0000 (+0000) Subject: added opensrf.system.sleep method; takes 1 param (seconds); useful for debugging... X-Git-Tag: osrf_rel_2_1_0-alpha1~109 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7cf442d238a883bd33ab60725ee0f86cc1cbc2d3;p=OpenSRF.git added opensrf.system.sleep method; takes 1 param (seconds); useful for debugging child process management git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@2111 9efc2488-bf62-4759-914b-345cdb29e865 --- diff --git a/src/perl/lib/OpenSRF/Application.pm b/src/perl/lib/OpenSRF/Application.pm index 4a36baf..29787e2 100644 --- a/src/perl/lib/OpenSRF/Application.pm +++ b/src/perl/lib/OpenSRF/Application.pm @@ -744,6 +744,24 @@ sub make_stream_atomic { } +__PACKAGE__->register_method( + method => 'sleep_method', + argc => 1, + api_name => 'opensrf.system.sleep', + signature => { + desc => q/Causes the backend process to sleep for the specified amount of time/, + params => [ {desc => q/Number of seconds to sleep; defaults to 1/, type => 'number'} ], + return => { desc => q/The number of seconds slept/, type => 'number' } + } +); + +sub sleep_method { + my($self, $client, $secs) = @_; + $secs ||= 1; + CORE::sleep($secs); + return $secs; +} + 1;