enqueue/async-command
Symfony Console extension to run commands asynchronously by pushing execution requests to a message queue via Enqueue. Useful for offloading long-running tasks and integrating CLI workflows with MQ-based background processing.
Command interface, Application class). Laravel’s Artisan commands differ in structure, requiring abstraction or wrapper logic.execute(InputInterface, OutputInterface), while Laravel’s Artisan::call() or Handle traits may need adapters to bridge the gap.failed_jobs table).Command).queue:work, dispatch()).Laravel\Bus or Laravel\Queue interfaces).queue:work or Horizon?Console component to work with Laravel’s Artisan?forma-pro) responsive to Laravel-specific issues? If not, is the team willing to maintain a fork?Laravel\Queue + Laravel\Horizon achieve the same goals with lower risk?Illuminate\Queue (Redis, database, etc.) and Illuminate\Console\Scheduling.dispatch(), queue:work) for async commands. Leverage Artisan::command() + Handle traits for background jobs.Command (e.g., AsyncCommand::dispatch(new MyCommand)).LaravelAsyncCommand class) to test feasibility.use Symfony\Component\Console\Command\Command;
use Illuminate\Support\Facades\Bus;
class LaravelAsyncCommand extends Command {
protected function execute(InputInterface $input, OutputInterface $output) {
Bus::dispatch(new AsyncJob($this->getName(), $input->all()));
}
}
Artisan::call() with async variants where needed.jobs table (unlikely without customization).InputInterface/OutputInterface. Laravel jobs use Handle methods. Map these explicitly.replace in composer.json or aliases.composer.json.queue:failed-table and Enqueue’s monitoring tools (e.g., enqueue:consume) in tandem.queue:work --daemon.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Enqueue transport failure | Async commands hang or fail silently. | Fallback to Laravel’s queue driver; implement retry logic. |
| Symfony command crashes | Job fails in queue without Laravel’s failed_jobs visibility. |
Wrap commands in try-catch; log to Laravel’s failure table. |
| Dependency conflicts | Breaks Laravel app during composer install. |
Use composer.json overrides or Docker containers to isolate dependencies. |
| Queue worker crashes | Backlog of undelivered commands. | Use Laravel’s supervisor or queue:work --sleep for resilience. |
| Laravel/Symfony version mismatch | Adapter breaks due to API changes. | Test against multiple versions; consider a polyfill layer. |
Console and Laravel’s Queue systems.AsyncCommand::dispatch() instead of Artisan::call()").How can I help you explore Laravel packages today?