Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.4] Job based queue options #16257

Merged
merged 4 commits into from
Nov 4, 2016
Merged

[5.4] Job based queue options #16257

merged 4 commits into from
Nov 4, 2016

Conversation

themsaid
Copy link
Member

@themsaid themsaid commented Nov 3, 2016

In reference to laravel/ideas#289 and laravel/ideas#290, this is an attempt to introduce Job based queue worker options:

class TestJob implements ShouldQueue
{
    use InteractsWithQueue, Queueable, SerializesModels;

    /**
     * The number of retries before the job fails.
     *
     * @var int
     */
    public $retries = 10;

    /**
     * The time the job should run.
     *
     * @var int
     */
    public $timeout = 120;

    public function handle()
    {
        
    }
}

The options in the job class will override the options given to the queue:work and queue:listen commands.

@tomschlick
Copy link
Contributor

This is fantastic 👍 🎉

@djtarazona
Copy link
Contributor

djtarazona commented Nov 4, 2016

Thanks for your work on this! ❤️

Would it be better to name the property $tries instead of $retries to match the queue command option name (--tries)? Just a thought. :)

@taylorotwell taylorotwell merged commit 5377009 into laravel:master Nov 4, 2016
@mintalicious
Copy link

Using Laravel 5.4.19 the $timeout option is not working for me. The value configured in config/queue.php is taken for that job.
I also tried $retry_after but without success.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants