Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Dynamic Servers Laravel Package

spatie/laravel-dynamic-servers

Dynamically spin up and destroy servers from Laravel to handle variable queue workloads. Uses provider snapshots as templates and lets you determine server count (e.g., based on Horizon wait times) so extra workers are created automatically and removed when no longer needed.

View on GitHub
Deep Wiki
Context7

title: Overriding actions and jobs weight: 5

You can have fine-grained control over how this package works under the hood. Most of its behaviour is implemented in actions and jobs that are registered in the actions and jobs config keys of the dynamic-servers config file.

You can override the behaviour by creating a class of your own that extends one of the defaults, and use your own class name in the config file.

Let's for example customize the GenerateServerNameAction class.

First, create a class that extends the default one and add your own implementation

namespace App\Support;

use Spatie\DynamicServers\Actions\GenerateServerNameAction as BaseAction;

use Spatie\DynamicServers\Actions\GenerateServerNameAction;

class MyCustomGenerateServerNameAction extends BaseAction
{
        public function execute(Server $server): string
    {
        return "jolly-good-server-{$server->type}-{$server->id}";
    }
}

Next, specify you class in the config file.

// in config/dynamic-servers.php

return [
// ... other options

    'actions' => [
        'generate_server_name' => App\Support\MyCustomGenerateServerNameAction::class,
        
        // ... other actions
];
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport