queuedjob.php 571 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /**
  3. * Copyright (c) 2013 Robin Appelman <icewind@owncloud.com>
  4. * This file is licensed under the Affero General Public License version 3 or
  5. * later.
  6. * See the COPYING-README file.
  7. */
  8. namespace OC\BackgroundJob;
  9. /**
  10. * Class QueuedJob
  11. *
  12. * create a background job that is to be executed once
  13. *
  14. * @package OC\BackgroundJob
  15. */
  16. abstract class QueuedJob extends Job {
  17. /**
  18. * run the job, then remove it from the joblist
  19. *
  20. * @param JobList $jobList
  21. */
  22. public function execute($jobList) {
  23. $jobList->remove($this);
  24. $this->run($this->argument);
  25. }
  26. }