laravel-php Artisan--queue Parameter Error!

Source: Internet
Author: User

Error message:

Reply content:

Error message:

makeis the command to create a PHP file, you make:command create a command line task, such as you create a command, you can execute the test test task at the command line php artisan test .

The tasks used for queue execution are typically "Job", by php artisan make:job creating a job class and then dispatch(new FooJob) performing this task in code. If this job is required to execute (asynchronously) in the queue (queues), the job class is implemented ShouldQueue . When the job is added to a queue, the queue itself is to be started to ensure that the added job can be executed on a schedule and the queue is started with the php artisan queue:work command line. The official documentation is very clear about all of these, and it's good grasp to look at it a few more times.
Https://laravel.com/docs/5.3/...
Chinese: Https://laravel-china.org/doc ...

When creating an event listener (listener) file, you can add parameters queued to mark the listener to execute asynchronously in the queue, for example php artisan make:listener Foobar --queued , to EventServiceProvider define the correspondence between event events and listener. Using a function in code to event() trigger an event, the framework invokes its code according to the listener defined in Eventserviceprovider, and if the listener is a queue, it is added to the queue.

Events, tasks, listening, and notifications in Laravel are related to the queue. But command (command line) has nothing to do with the queue, and command can be understood as php artisan a command-line tool that follows. Command-line tools can be added to the system's scheduled tasks cron to be executed according to scheduled time, such as restarting the server 3 o'clock in the morning every day. Laravel provides a convenient way to implement cron scheduling tasks in the system, which app/Console/Kernel.php can be schedule written in the method.

There is no--queued option, what do you want to do?

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.