2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

Blocking.pm: Change the doc

git-svn-id: https://svn.fhem.de/fhem/trunk@8048 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2015-02-20 19:30:01 +00:00
parent 71a1d30444
commit 68ad56c8b6

View File

@ -4,11 +4,15 @@ package main;
=pod
### Usage:
sub TestBlocking { BlockingCall("DoSleep", {h=>$defs{CUL}, to=>3,cmd=>"CmdTxt"},
"SleepDone", 8, "AbortFn", "AbortArg"); }
Define the following in your 99_myUtils.pm
sub TestBlocking($){ BlockingCall("DoSleep", shift, "SleepDone", 5, "AbortFn", "AbortArg"); }
sub DoSleep($) { sleep(shift); return "I'm done"; }
sub SleepDone($) { Log 1, "SleepDone: " . shift; }
sub AbortFn($) { Log 1, "Aborted: " . shift; }
Then call from the fhem prompt
{ TestBlocking(3) }
{ TestBlocking(6) }
and watch the fhem log.
=cut