mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 18:59:33 +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:
parent
71a1d30444
commit
68ad56c8b6
@ -4,11 +4,15 @@ package main;
|
|||||||
|
|
||||||
=pod
|
=pod
|
||||||
### Usage:
|
### Usage:
|
||||||
sub TestBlocking { BlockingCall("DoSleep", {h=>$defs{CUL}, to=>3,cmd=>"CmdTxt"},
|
Define the following in your 99_myUtils.pm
|
||||||
"SleepDone", 8, "AbortFn", "AbortArg"); }
|
sub TestBlocking($){ BlockingCall("DoSleep", shift, "SleepDone", 5, "AbortFn", "AbortArg"); }
|
||||||
sub DoSleep($) { sleep(shift); return "I'm done"; }
|
sub DoSleep($) { sleep(shift); return "I'm done"; }
|
||||||
sub SleepDone($) { Log 1, "SleepDone: " . shift; }
|
sub SleepDone($) { Log 1, "SleepDone: " . shift; }
|
||||||
sub AbortFn($) { Log 1, "Aborted: " . shift; }
|
sub AbortFn($) { Log 1, "Aborted: " . shift; }
|
||||||
|
Then call from the fhem prompt
|
||||||
|
{ TestBlocking(3) }
|
||||||
|
{ TestBlocking(6) }
|
||||||
|
and watch the fhem log.
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user