<?php

namespace Drupal\mymodule\Plugin\QueueWorker;

use Drupal\Core\Queue\QueueWorkerBase;

/**
 * Comments
 *
 * @QueueWorker (
 *  id = "mymodule_swapi",
 *  title = "Queue swapi",
 *  cron = {"time" = 60}
 * )
 */
class QueueSwapi extends QueueWorkerBase {

  public function processItem($data) {
    $api = \Drupal::service('mymodule.custom_services');
    $node = $api->getNodeByUrl($data['url']);
    $api->edited($data, $node);
  }
}
