maxbrokman / safequeue Goto Github PK
View Code? Open in Web Editor NEWLaravel Doctrine friendly queue worker
License: MIT License
Laravel Doctrine friendly queue worker
License: MIT License
Trying to implement the SafeQueue in lumen 5.5 I run into the issue that the command_name wont overwrite laravels own queue:work.
Config
'command_name' => false,
Bootstrap/App
$app->register(MaxBrokman\SafeQueue\DoctrineQueueProvider::class);
$app->configure('safequeue');
Could this be due to any 5.5 changes? and any ideas to a possible solution?
Can I use this package with Laravel Horizon?
How to start doctrine:queue:work
using Laravel Horizon (Laravel 5.5 or 5.6)?
doctrine:queue:work without --daemon is not restarting the core.
So changes done to the jobs are not respected without restarting the worker, as work:listen would do.
Will you be adding support for Laravel 6?
hi,
any plans for 5.4. or is it working too?
thx
I've reported this against Laravel but we actually use your queue implementation since we use Doctrine. That being the case I'm reporting it here too since you re-implement the same, not quite right, code that handles this.
Essentially, it's taken three servers with hard drives full of exception logs to track down that workers should not try to do the same thing over and over again.
I looked into using this package for a project I'm working on, but I wanted to throw out a question about the architecture of your worker. It seems to me that your worker is a little more fragile than it needs to be because it's re-implementing parent methods (seemingly just for unit test purposes).
It seems to me that it would be better to let the parent class do as much as possible. That way any future improvements or bug fixes to the parent worker don't have to be re-implemented in your child worker.
I created a solution based off your work (which is very much appreciated), but tried to keep it more bare-bones. The core logic of my child worker is below (the only methods I override are __construct()
and runNextJob()
). Do you think this approach is something you would be interested in taking for your implementation?
public function runNextJob($connectionName, $queue, WorkerOptions $options)
{
try {
$this->assertClearAndOpenEntityManager();
$this->assertDatabaseConnected();
parent::runNextJob($connectionName, $queue, $options);
} catch (EntityManagerClosedException $e) {
$this->exceptions->report($e);
$this->stop();
} catch (Exception $e) {
$this->exceptions->report($e);
$this->sleep($options->sleep);
} catch (Throwable $e) {
$this->exceptions->report(new FatalThrowableError($e));
$this->sleep($options->sleep);
}
}
Jobs that fail due to a timeout just go round and round beyond maximum tries. Not sure if this is an upstream issue or not.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.