From 8690b11c5d6569946f9621e481ec608d5733a0a3 Mon Sep 17 00:00:00 2001 From: dbs Date: Tue, 22 Feb 2011 17:41:00 +0000 Subject: [PATCH] added opensrf.system.sleep method; takes 1 param (seconds); useful for debugging child process management git-svn-id: svn://svn.open-ils.org/OpenSRF/branches/rel_2_0@2170 9efc2488-bf62-4759-914b-345cdb29e865 --- src/perl/lib/OpenSRF/Application.pm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/perl/lib/OpenSRF/Application.pm b/src/perl/lib/OpenSRF/Application.pm index 6ebfe4b..e37b142 100644 --- a/src/perl/lib/OpenSRF/Application.pm +++ b/src/perl/lib/OpenSRF/Application.pm @@ -743,4 +743,22 @@ sub make_stream_atomic { return \@results; } +__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; -- 2.11.0