Skip to content

Commit

Permalink
return pending dispatch for artisan::queue
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Apr 19, 2017
1 parent 01fdf25 commit 51647eb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Illuminate/Contracts/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function call($command, array $parameters = []);
*
* @param string $command
* @param array $parameters
* @return int
* @return \Illuminate\Foundation\Bus\PendingDispatch
*/
public function queue($command, array $parameters = []);

Expand Down
6 changes: 2 additions & 4 deletions src/Illuminate/Foundation/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,11 @@ public function call($command, array $parameters = [], $outputBuffer = null)
*
* @param string $command
* @param array $parameters
* @return void
* @return \Illuminate\Foundation\Bus\PendingDispatch
*/
public function queue($command, array $parameters = [])
{
$this->app[QueueContract::class]->push(
new QueuedCommand(func_get_args())
);
return QueuedCommand::dispatch(func_get_args());
}

/**
Expand Down
4 changes: 4 additions & 0 deletions src/Illuminate/Foundation/Console/QueuedCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@

namespace Illuminate\Foundation\Console;

use Illuminate\Bus\Queueable;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Contracts\Console\Kernel as KernelContract;

class QueuedCommand implements ShouldQueue
{
use Dispatchable, Queueable;

/**
* The data to pass to the Artisan command.
*
Expand Down

1 comment on commit 51647eb

@crynobone
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

Please sign in to comment.