Blocking.pm: add blockinginfo command (Forum #73490)
git-svn-id: https://svn.fhem.de/fhem/trunk@14649 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -26,8 +26,8 @@ sub BlockingKill($);
|
|||||||
sub BlockingInformParent($;$$);
|
sub BlockingInformParent($;$$);
|
||||||
sub BlockingStart(;$);
|
sub BlockingStart(;$);
|
||||||
|
|
||||||
use vars qw($BC_telnetDevice);
|
our $BC_telnetDevice;
|
||||||
use vars qw(%BC_hash);
|
our %BC_hash;
|
||||||
my $telnetClient;
|
my $telnetClient;
|
||||||
my $bc_pid = 0;
|
my $bc_pid = 0;
|
||||||
|
|
||||||
@@ -73,9 +73,30 @@ BC_searchTelnet($)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub
|
||||||
|
BlockingInfo($$@)
|
||||||
|
{
|
||||||
|
my @ret;
|
||||||
|
foreach my $h (values %BC_hash) {
|
||||||
|
next if($h->{terminated} || !$h->{pid});
|
||||||
|
my $fn = (ref($h->{fn}) ? ref($h->{fn}) : $h->{fn});
|
||||||
|
my $arg = (ref($h->{arg}) ? ref($h->{arg}) : $h->{arg});
|
||||||
|
my $to = ($h->{timeout} ? $h->{timeout} : "N/A");
|
||||||
|
push @ret, "Pid:$h->{pid} Fn:$fn Arg:$arg Timeout:$to";
|
||||||
|
}
|
||||||
|
push @ret, "No BlockingCall processes running currently" if(!@ret);
|
||||||
|
return join("\n", @ret);
|
||||||
|
}
|
||||||
|
|
||||||
sub
|
sub
|
||||||
BlockingCall($$@)
|
BlockingCall($$@)
|
||||||
{
|
{
|
||||||
|
my %hash = (
|
||||||
|
Fn => "BlockingInfo",
|
||||||
|
Hlp => ",show info about processes started by BlockingCall"
|
||||||
|
);
|
||||||
|
$cmds{blockinginfo} = \%hash;
|
||||||
|
|
||||||
my ($blockingFn, $arg, $finishFn, $timeout, $abortFn, $abortArg) = @_;
|
my ($blockingFn, $arg, $finishFn, $timeout, $abortFn, $abortArg) = @_;
|
||||||
|
|
||||||
my %h = ( pid=>'WAITING:', fn=>$blockingFn, arg=>$arg, finishFn=>$finishFn,
|
my %h = ( pid=>'WAITING:', fn=>$blockingFn, arg=>$arg, finishFn=>$finishFn,
|
||||||
|
|||||||
Reference in New Issue
Block a user