original_string: private function cancelPending()
      {
          if (!$this->busyQueue->isEmpty()) {
              $exception = new WorkerException('Worker was shut down.');
  
              do {
                  $this->busyQueue->dequeue()->cancel($exception);
              } while (!$this->busyQueue->isEmpty());
          }
      }
code: private function cancelPending()
      {
          if (!$this->busyQueue->isEmpty()) {
              $exception = new WorkerException('Worker was shut down.');
  
              do {
                  $this->busyQueue->dequeue()->cancel($exception);
              } while (!$this->busyQueue->isEmpty());
          }
      }
code_tokens: private function cancelPending ( ) { if ( ! $ this -> busyQueue -> isEmpty ( ) ) { $ exception = new WorkerException ( 'Worker was shut down.' ) ; do { $ this -> busyQueue -> dequeue ( ) -> cancel ( $ exception ) ; } while ( ! $ this -> busyQueue -> isEmpty ( ) ) ; } }
docstring: Cancels all pending tasks.
docstring_tokens: Cancels all pending tasks .