PHP - Worker::isWorking() 函式



Worker::isWorking - 狀態檢測

語法

public boolean Worker::isWorking( void )

Worker::isWorking() 函式可以判斷 Worker 是否正在執行 Stackables。

Worker::isWorking() 函式沒有任何引數,並返回一個表示狀態的布林值。

示例

<?php
   class My extends Worker {
      public function run() {
         /* ... */
      }
   }
   $my = new My();
   $my->start();
   
   if($my->isWorking()) {
      /* ... the Worker is busy executing another object */
   }
?>
php_function_reference.htm
廣告