<?php

namespace PortalPeople\queues;

use common\components\Queue\JobInterface;

/**
 * Recurring Job Interface
 * 
 * Implement this interface for jobs that should automatically re-queue themselves
 * after execution. Configure recurring jobs in params['settings']['queues']['recurring'].
 * 
 * @author Portal People
 */
interface RecurringJobInterface extends JobInterface
{
    /**
     * Get the interval in seconds before the job should run again.
     * 
     * @return int Delay in seconds until next execution
     */
    public function getRecurringInterval();
    
    /**
     * Determine if the job should continue recurring.
     * Return false to stop the recurring cycle.
     * 
     * @return bool Whether to re-queue after execution
     */
    public function shouldContinue();
}
