Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
shahramfdl authored Apr 28, 2022
2 parents 3301f6e + 2401f7c commit f1279af
Show file tree
Hide file tree
Showing 14 changed files with 116 additions and 76 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG-12x.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

All notable changes to this project will be documented in this file.

## [Unreleased](https://github.com/vyuldashev/laravel-queue-rabbitmq/compare/v12.0.0...master)
## [Unreleased](https://github.com/vyuldashev/laravel-queue-rabbitmq/compare/v12.0.1...master)

## [12.0.1 (2022-04-06)](https://github.com/vyuldashev/laravel-queue-rabbitmq/compare/v12.0.0...v12.0.1)

- Allow laravel to end workers with lost connection [#457](https://github.com/vyuldashev/laravel-queue-rabbitmq/pull/457)

## [12.0.0 (2022-02-23)](https://github.com/vyuldashev/laravel-queue-rabbitmq/compare/v11.4.0...v12.0.0)

Expand Down
3 changes: 2 additions & 1 deletion src/Console/ExchangeDeclareCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ class ExchangeDeclareCommand extends Command
protected $description = 'Declare exchange';

/**
* @param RabbitMQConnector $connector
* @param RabbitMQConnector $connector
*
* @throws Exception
*/
public function handle(RabbitMQConnector $connector): void
Expand Down
3 changes: 2 additions & 1 deletion src/Console/ExchangeDeleteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ class ExchangeDeleteCommand extends Command
protected $description = 'Delete exchange';

/**
* @param RabbitMQConnector $connector
* @param RabbitMQConnector $connector
*
* @throws Exception
*/
public function handle(RabbitMQConnector $connector): void
Expand Down
3 changes: 2 additions & 1 deletion src/Console/QueueBindCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ class QueueBindCommand extends Command
protected $description = 'Bind queue to exchange';

/**
* @param RabbitMQConnector $connector
* @param RabbitMQConnector $connector
*
* @throws Exception
*/
public function handle(RabbitMQConnector $connector): void
Expand Down
3 changes: 2 additions & 1 deletion src/Console/QueueDeclareCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ class QueueDeclareCommand extends Command
protected $description = 'Declare queue';

/**
* @param RabbitMQConnector $connector
* @param RabbitMQConnector $connector
*
* @throws Exception
*/
public function handle(RabbitMQConnector $connector): void
Expand Down
3 changes: 2 additions & 1 deletion src/Console/QueueDeleteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ class QueueDeleteCommand extends Command
protected $description = 'Delete queue';

/**
* @param RabbitMQConnector $connector
* @param RabbitMQConnector $connector
*
* @throws Exception
*/
public function handle(RabbitMQConnector $connector): void
Expand Down
3 changes: 2 additions & 1 deletion src/Console/QueuePurgeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ class QueuePurgeCommand extends Command
protected $description = 'Purge all messages in queue';

/**
* @param RabbitMQConnector $connector
* @param RabbitMQConnector $connector
*
* @throws Exception
*/
public function handle(RabbitMQConnector $connector): void
Expand Down
15 changes: 8 additions & 7 deletions src/Consumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,11 @@ public function setPrefetchCount(int $value): void
/**
* Listen to the given queue in a loop.
*
* @param string $connectionName
* @param string $queue
* @param WorkerOptions $options
* @param string $connectionName
* @param string $queue
* @param WorkerOptions $options
* @return int
*
* @throws Throwable
*/
public function daemon($connectionName, $queue, WorkerOptions $options)
Expand Down Expand Up @@ -147,7 +148,7 @@ function (AMQPMessage $message) use ($connection, $options, $connectionName, $qu
$this->exceptions->report($exception);

$this->kill(1);
} catch (Exception | Throwable $exception) {
} catch (Exception|Throwable $exception) {
$this->exceptions->report($exception);

$this->stopWorkerIfLostConnection($exception);
Expand Down Expand Up @@ -180,9 +181,9 @@ function (AMQPMessage $message) use ($connection, $options, $connectionName, $qu
/**
* Determine if the daemon should process on this iteration.
*
* @param WorkerOptions $options
* @param string $connectionName
* @param string $queue
* @param WorkerOptions $options
* @param string $connectionName
* @param string $queue
* @return bool
*/
protected function daemonShouldRun(WorkerOptions $options, $connectionName, $queue): bool
Expand Down
4 changes: 2 additions & 2 deletions src/Horizon/Listeners/RabbitMQFailedEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class RabbitMQFailedEvent
/**
* Create a new listener instance.
*
* @param Dispatcher $events
* @param Dispatcher $events
* @return void
*/
public function __construct(Dispatcher $events)
Expand All @@ -30,7 +30,7 @@ public function __construct(Dispatcher $events)
/**
* Handle the event.
*
* @param LaravelJobFailed $event
* @param LaravelJobFailed $event
* @return void
*/
public function handle(LaravelJobFailed $event): void
Expand Down
13 changes: 8 additions & 5 deletions src/Horizon/RabbitMQQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ class RabbitMQQueue extends BaseRabbitMQQueue
/**
* Get the number of queue jobs that are ready to process.
*
* @param string|null $queue
* @param string|null $queue
* @return int
*
* @throws AMQPProtocolChannelException
*/
public function readyNow($queue = null): int
Expand Down Expand Up @@ -93,9 +94,10 @@ public function release($delay, $job, $data, $queue, $attempts = 0)
/**
* Fire the job deleted event.
*
* @param string $queue
* @param RabbitMQJob $job
* @param string $queue
* @param RabbitMQJob $job
* @return void
*
* @throws BindingResolutionException
*/
public function deleteReserved($queue, $job): void
Expand All @@ -106,9 +108,10 @@ public function deleteReserved($queue, $job): void
/**
* Fire the given event if a dispatcher is bound.
*
* @param string $queue
* @param mixed $event
* @param string $queue
* @param mixed $event
* @return void
*
* @throws BindingResolutionException
*/
protected function event($queue, $event): void
Expand Down
9 changes: 5 additions & 4 deletions src/Queue/Connectors/RabbitMQConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ public function __construct(Dispatcher $dispatcher)
/**
* Establish a queue connection.
*
* @param array $config
*
* @param array $config
* @return RabbitMQQueue
*
* @throws Exception
*/
public function connect(array $config): Queue
Expand Down Expand Up @@ -64,8 +64,9 @@ public function connect(array $config): Queue
}

/**
* @param array $config
* @param array $config
* @return AbstractConnection
*
* @throws Exception
*/
protected function createConnection(array $config): AbstractConnection
Expand Down Expand Up @@ -112,7 +113,7 @@ protected function createQueue(
/**
* Recursively filter only null values.
*
* @param array $array
* @param array $array
* @return array
*/
private function filter(array $array): array
Expand Down
3 changes: 2 additions & 1 deletion src/Queue/Jobs/RabbitMQJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ public function delete(): void
/**
* Release the job back into the queue.
*
* @param int $delay
* @param int $delay
*
* @throws AMQPProtocolChannelException
*/
public function release($delay = 0): void
Expand Down
Loading

0 comments on commit f1279af

Please sign in to comment.