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

Roadrunner Symfony Dumper Laravel Package

dgero/roadrunner-symfony-dumper

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Installation Add the package via Composer:

    composer require dgero/roadrunner-symfony-dumper
    

    Register the service provider in config/app.php:

    'providers' => [
        // ...
        Dgero\RoadRunnerSymfonyDumper\RoadRunnerSymfonyDumperServiceProvider::class,
    ],
    
  2. Configure RoadRunner Ensure your rr.yaml includes the dumper worker:

    workers:
      http:
        pool:
          num_workers: 4
      dumper:
        pool:
          num_workers: 1
    
  3. First Use Case Trigger a dump via Symfony’s Debug component:

    use Symfony\Component\Debug\Dumper\DataDumper;
    
    $data = ['key' => 'value'];
    $dumper = new DataDumper();
    $dumper->dump($data); // Outputs to RoadRunner's dumper worker
    

Implementation Patterns

Workflow Integration

  • Debugging HTTP Requests Use the dumper in middleware or controllers to inspect request/response cycles:

    public function handle(Request $request, Closure $next) {
        $data = ['request' => $request->all()];
        (new DataDumper())->dump($data);
        return $next($request);
    }
    
  • CLI Debugging Attach the dumper to Artisan commands for debugging CLI logic:

    public function handle() {
        $data = ['command' => 'custom:command'];
        (new DataDumper())->dump($data);
        // ... command logic
    }
    
  • Event Listeners Dump data during critical events (e.g., Kernel::terminate):

    public function handle(object $event, Closure $next) {
        (new DataDumper())->dump(['event' => $event]);
        $next($event);
    }
    

RoadRunner-Specific Tips

  • Worker Isolation Configure the dumper worker separately in rr.yaml to avoid blocking HTTP workers:

    dumper:
      pool:
        num_workers: 1
        max_jobs: 10
    
  • Output Handling Redirect dumper output to a file or log:

    server:
      dump_output: /var/log/roadrunner/dumps.log
    

Gotchas and Tips

Pitfalls

  • Blocking HTTP Workers Avoid dumping large datasets in HTTP workers—offload to the dumper worker to prevent timeouts.

  • Missing Configuration Ensure dumper worker is enabled in rr.yaml; otherwise, dumps will silently fail.

  • Symfony Debug Mode The dumper requires Symfony’s Debug component. Verify APP_DEBUG=true in .env for CLI/HTTP contexts.

Debugging

  • Check RoadRunner Logs Use rr logs to verify dumper worker activity:

    rr logs -w dumper
    
  • Disable Dumps in Production Wrap dumps in debug checks:

    if (app()->environment('local')) {
        (new DataDumper())->dump($data);
    }
    

Extension Points

  • Custom Dumper Classes Extend DataDumper to format output (e.g., JSON, HTML):

    class CustomDumper extends DataDumper {
        public function dump($data) {
            $this->output->writeln(json_encode($data, JSON_PRETTY_PRINT));
        }
    }
    
  • RoadRunner Plugins Combine with roadrunner/roadrunner plugins (e.g., roadrunner/health) for unified monitoring.

  • Performance Tuning Adjust max_jobs in rr.yaml to balance dump volume and worker load:

    dumper:
      pool:
        max_jobs: 5  # Limit concurrent dumps
    
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.
comsave/common
alecsammon/php-raml-parser
chrome-php/wrench
lendable/composer-license-checker
typhoon/reflection
mesilov/moneyphp-percentage
mike42/gfx-php
bookdown/themes
aura/view
aura/html
aura/cli
povils/phpmnd
nayjest/manipulator
omnipay/tests
psr-mock/http-message-implementation
psr-mock/http-factory-implementation
psr-mock/http-client-implementation
voku/email-check
voku/urlify
rtheunissen/guzzle-log-middleware