maxbrokman / SafeQueue

Laravel Doctrine friendly queue worker
MIT License
30 stars 28 forks source link

Support Laravel 6.0 #24

Closed motia closed 4 years ago

motia commented 5 years ago

Hi, I have updated the code to support laravel 6.

I did not find any major changes besides those of the constructors of the Worker and WorkerCommand base classes. So this PR has breaking changes to laravel 5 and it would be best to put it in a 0.4 branch.

Also, I had to swap the php-cs-fixer as the old version did not support php7 and was moved to another repository.

Thank you.

coveralls commented 5 years ago

Coverage Status

Coverage decreased (-3.5%) to 72.222% when pulling c431d7e4229a7a7b61079fd1d0ceb406e57cd54d on motia:0.4 into 21744ad28dce46576628920d3962e23381492355 on maxbrokman:0.3.

sojeda commented 5 years ago

Any update?

dpslwk commented 4 years ago

@maxbrokman could we get this merged please?

kfeng0806 commented 4 years ago

Hey @motia , i'm getting following error while using this PR

> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

In Container.php line 993:

  Unresolvable dependency resolving [Parameter #4 [ <required> callable $isDo
  wnForMaintenance ]] in class MaxBrokman\SafeQueue\Worker

Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

After disabled exception got null argument error

$ composer dumpautoload
Generating optimized autoload filesocramius/package-versions: Generating version class...
ocramius/package-versions: ...done generating version class
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

In Worker.php line 33:

  Argument 5 passed to MaxBrokman\SafeQueue\Worker::__construct() must be cal
  lable, null given

Seems you can't pass callable function twice to parent::__construct() in MaxBrokman\SafeQueue\Worker line 40 It works when i changed the MaxBrokman\SafeQueue\Worker construct to

public function __construct(
        QueueManager $manager,
        Dispatcher $events,
        EntityManager $entityManager,
        ExceptionHandler $exceptions
    ) {
        $isDownForMaintenance = function () {
            return app()->isDownForMaintenance();
        };

        parent::__construct($manager, $events, $exceptions, $isDownForMaintenance);

        $this->entityManager = $entityManager;
}