Skip to content
This repository was archived by the owner on Nov 9, 2020. It is now read-only.

Commit 1073c7c

Browse files
committed
Fix access to QueueManager instance for Lumen
1 parent f84798b commit 1073c7c

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

src/Http/Controllers/QueueController.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,36 @@
55
use Illuminate\Http\Request;
66
use Illuminate\Http\Response;
77
use Illuminate\Routing\Controller;
8-
use Illuminate\Queue\QueueManager;
98

109
class QueueController extends Controller
1110
{
1211
/**
1312
* Get the size of a queue
1413
*
15-
* @param QueueManager $manager
1614
* @param string $queue
1715
*
1816
* @return int
1917
*/
20-
public function show(QueueManager $manager, $queue)
18+
public function show($queue)
2119
{
22-
return $manager->connection()->size($queue);
20+
return app('queue')->connection()->size($queue);
2321
}
2422

2523
/**
2624
* Accept a new job and push it to the local queue.
2725
*
2826
* @param Request $request
29-
* @param QueueManager $manager
3027
* @param string $queue
3128
*/
32-
public function store(Request $request, QueueManager $manager, $queue)
29+
public function store(Request $request, $queue)
3330
{
3431
$payload = $request->getContent();
3532

3633
if (!$payload) {
3734
return new Response('Job payload is required', 422);
3835
}
3936

40-
$manager->connection(config('remote-queue.connection'))
37+
app('queue')->connection(config('remote-queue.connection'))
4138
->pushRaw($payload, $queue);
4239

4340
}

src/RemoteQueueServiceProvider.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Biigle\RemoteQueue;
44

55
use Illuminate\Routing\Router;
6-
use Illuminate\Queue\QueueManager;
76
use Illuminate\Support\ServiceProvider;
87
use Biigle\RemoteQueue\Http\Middleware\Authenticate;
98

@@ -14,9 +13,9 @@ class RemoteQueueServiceProvider extends ServiceProvider
1413
*
1514
* @return void
1615
*/
17-
public function boot(QueueManager $manager, Router $router)
16+
public function boot(Router $router)
1817
{
19-
$manager->addConnector('remote', function() {
18+
$this->app['queue']->addConnector('remote', function() {
2019
return new RemoteConnector;
2120
});
2221

0 commit comments

Comments
 (0)