Skip to content

Commit 821ff2a

Browse files
authored
Merge pull request #9 from php-enqueue/0.9
0.9 version
2 parents 5906753 + 9b01008 commit 821ff2a

17 files changed

+240
-285
lines changed

composer.json

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,18 @@
55
"keywords": ["messaging", "queue", "laravel"],
66
"license": "MIT",
77
"require": {
8-
"php": ">=5.6",
9-
"illuminate/queue": "^5.4",
10-
"queue-interop/queue-interop": "^0.6",
11-
"queue-interop/amqp-interop": "^0.7",
12-
"enqueue/amqp-tools": "^0.8"
8+
"php": ">=7.1",
9+
"illuminate/queue": "^5.6",
10+
"queue-interop/amqp-interop": "0.8.x-dev",
11+
"queue-interop/queue-interop": "0.7.x-dev",
12+
"enqueue/enqueue": "0.9.x-dev",
13+
"enqueue/dsn": "0.9.x-dev"
1314
},
1415
"require-dev": {
1516
"phpunit/phpunit": "~5.5",
16-
"enqueue/enqueue": "^0.8@dev",
17-
"enqueue/null": "^0.8@dev",
18-
"enqueue/test": "^0.8@dev"
17+
"enqueue/enqueue": "0.9.x-dev",
18+
"enqueue/null": "0.9.x-dev",
19+
"enqueue/test": "0.9.x-dev"
1920
},
2021
"autoload": {
2122
"psr-4": { "Enqueue\\LaravelQueue\\": "src/" },
@@ -33,7 +34,7 @@
3334
]
3435
},
3536
"branch-alias": {
36-
"dev-master": "0.8.x-dev"
37+
"dev-master": "0.9.x-dev"
3738
}
3839
}
3940
}

src/AmqpConnector.php

Lines changed: 0 additions & 39 deletions
This file was deleted.

src/AmqpQueue.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55
use Interop\Amqp\AmqpContext;
66

77
/**
8-
* @method AmqpContext getPsrContext()
8+
* @method AmqpContext getQueueInteropContext()
99
*/
1010
class AmqpQueue extends Queue
1111
{
1212
/**
1313
* {@inheritdoc}
1414
*
15-
* @param AmqpContext $psrContext
15+
* @param AmqpContext $amqpContext
1616
*/
17-
public function __construct(AmqpContext $psrContext, $queueName, $timeToRun)
17+
public function __construct(AmqpContext $amqpContext, $queueName, $timeToRun)
1818
{
19-
parent::__construct($psrContext, $queueName, $timeToRun);
19+
parent::__construct($amqpContext, $queueName, $timeToRun);
2020
}
2121

2222
/**
@@ -54,9 +54,9 @@ public function pop($queue = null)
5454
*/
5555
protected function declareQueue($queue = null)
5656
{
57-
$psrQueue = $this->getQueue($queue);
58-
$psrQueue->addFlag(\Interop\Amqp\AmqpQueue::FLAG_DURABLE);
57+
$interopQueue = $this->getQueue($queue);
58+
$interopQueue->addFlag(\Interop\Amqp\AmqpQueue::FLAG_DURABLE);
5959

60-
$this->getPsrContext()->declareQueue($psrQueue);
60+
$this->getQueueInteropContext()->declareQueue($queue);
6161
}
6262
}

src/Command/ConsumeCommand.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
namespace Enqueue\LaravelQueue\Command;
3+
4+
use Enqueue\Container\Container;
5+
use Enqueue\SimpleClient\SimpleClient;
6+
7+
class ConsumeCommand extends \Enqueue\Symfony\Client\ConsumeCommand
8+
{
9+
public function __construct(SimpleClient $client)
10+
{
11+
$container = new Container([
12+
'queue_consumer' => $client->getQueueConsumer(),
13+
'driver' => $client->getDriver(),
14+
'processor' => $client->getDelegateProcessor()
15+
]);
16+
17+
parent::__construct($container, 'queue_consumer', 'driver', 'processor');
18+
}
19+
}

src/Command/ConsumeMessagesCommand.php

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/Command/ProduceCommand.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
namespace Enqueue\LaravelQueue\Command;
3+
4+
use Enqueue\Container\Container;
5+
use Enqueue\SimpleClient\SimpleClient;
6+
7+
class ProduceCommand extends \Enqueue\Symfony\Client\ProduceCommand
8+
{
9+
public function __construct(SimpleClient $client)
10+
{
11+
$container = new Container([
12+
'producer' => $client->getProducer(),
13+
]);
14+
15+
parent::__construct($container, 'producer');
16+
}
17+
}

src/Command/ProduceMessageCommand.php

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/Command/QueuesCommand.php

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/Command/RoutesCommand.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
namespace Enqueue\LaravelQueue\Command;
3+
4+
use Enqueue\Container\Container;
5+
use Enqueue\SimpleClient\SimpleClient;
6+
7+
class RoutesCommand extends \Enqueue\Symfony\Client\RoutesCommand
8+
{
9+
public function __construct(SimpleClient $client)
10+
{
11+
$container = new Container([
12+
'driver' => $client->getDriver(),
13+
]);
14+
15+
parent::__construct($container, 'driver');
16+
}
17+
}

src/Command/SetupBrokerCommand.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,17 @@
22
namespace Enqueue\LaravelQueue\Command;
33

44

5+
use Enqueue\Container\Container;
56
use Enqueue\SimpleClient\SimpleClient;
67

78
class SetupBrokerCommand extends \Enqueue\Symfony\Client\SetupBrokerCommand
89
{
910
public function __construct(SimpleClient $client)
1011
{
11-
parent::__construct($client->getDriver());
12+
$container = new Container([
13+
'driver' => $client->getDriver(),
14+
]);
15+
16+
parent::__construct($container, 'driver');
1217
}
1318
}

0 commit comments

Comments
 (0)