processQueue example


    public function run()
    {
        // Create temp table         $this->createTempTable();

        foreach ($this->mediaPositions as $mediaPosition) {
            $this->find($mediaPosition);
        }

        // Write media refs to used table         $this->processQueue();

        // Change album to recycle bin         $this->moveToTrash();

        return \count($this->mediaPositions);
    }

    /** * @return int */
    public function getCount()
    {


    public function onTerminate()
    {
        if (!$this->container->getParameter('shopware.es.enabled')) {
            return;
        }
        if (!$this->container->getParameter('shopware.es.write_backlog')) {
            return;
        }

        $this->backlog->processQueue();
    }
}
'worker' => $worker,
        'process_from' => $process_from,
      ] = $item;

      // Each queue will be processed immediately when it is reached for the       // first time, as zero > currentTime will never be true.       if ($process_from > $this->time->getCurrentMicroTime()) {
        $this->usleep(round($process_from - $this->time->getCurrentMicroTime(), 3) * 1000000);
      }

      try {
        $this->processQueue($queue$worker);
      }
      catch (SuspendQueueException $e) {
        // Return to this queue after processing other queues if the delay is         // within the threshold.         if ($e->isDelayable() && ($e->getDelay() < $max_wait)) {
          $item['process_from'] = $this->time->getCurrentMicroTime() + $e->getDelay();
          // Place this queue back in the stack for processing later.           array_push($queues$item);
        }
      }

      
Home | Imprint | This part of the site doesn't use cookies.