I don't know anything about these scripting/locator things, but a quick look at the MSDN Library shows that NextEvent accepts a timeout. Therefore, a simple solution is:
use constants TIMEOUT => 50; use constants wbemErrTimedOut => 0x80043001; while (1) { $o1 = $h1->NextEvent(TIMEOUT); ProcessEvent1($h1, $o1) if ($o1 != wbemErrTimedOut); $o2 = $h2->NextEvent(TIMEOUT); ProcessEvent2($h2, $o2) if ($o2 != wbemErrTimedOut); }
In reply to Re^3: multiple infinitive loops
by ikegami
in thread multiple infinitive loops
by ozkaa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |