Coder Social home page Coder Social logo

safequeue's People

Contributors

hodgy avatar leeovery avatar maxbrokman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

safequeue's Issues

safequeue not overwriting queue:work in lumen 5.5

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?

Architecture Question

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);
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.