{"id":46286010,"url":"https://github.com/giorgospatelis/laravel-parallel","last_synced_at":"2026-03-04T07:01:38.728Z","repository":{"id":323038787,"uuid":"1091898045","full_name":"giorgospatelis/laravel-parallel","owner":"giorgospatelis","description":"Simple parallel processing for Laravel - Powered by AMPHP with automatic CPU detection.","archived":false,"fork":false,"pushed_at":"2025-12-01T11:06:32.000Z","size":1371,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"develop","last_synced_at":"2025-12-17T18:29:10.417Z","etag":null,"topics":["amphp-sync","async","concurrent","laravel","multi-processing","parallel"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/giorgospatelis.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-07T17:25:12.000Z","updated_at":"2025-11-24T09:59:21.000Z","dependencies_parsed_at":"2025-11-27T11:12:20.796Z","dependency_job_id":null,"html_url":"https://github.com/giorgospatelis/laravel-parallel","commit_stats":null,"previous_names":["giorgospatelis/parallel-package","giorgospatelis/laravel-parallel"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/giorgospatelis/laravel-parallel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giorgospatelis%2Flaravel-parallel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giorgospatelis%2Flaravel-parallel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giorgospatelis%2Flaravel-parallel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giorgospatelis%2Flaravel-parallel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/giorgospatelis","download_url":"https://codeload.github.com/giorgospatelis/laravel-parallel/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giorgospatelis%2Flaravel-parallel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30075425,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T05:31:57.858Z","status":"ssl_error","status_checked_at":"2026-03-04T05:31:38.462Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amphp-sync","async","concurrent","laravel","multi-processing","parallel"],"created_at":"2026-03-04T07:01:33.676Z","updated_at":"2026-03-04T07:01:38.701Z","avatar_url":"https://github.com/giorgospatelis.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"art/banner.jpg\" alt=\"Laravel Parallel Banner\" width=\"100%\"\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eLaravel Parallel\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cstrong\u003eSimple parallel processing for Laravel - Powered by AMPHP with automatic CPU detection.\u003c/strong\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://packagist.org/packages/laravel-parallel/laravel-parallel\"\u003e\u003cimg src=\"https://img.shields.io/packagist/v/laravel-parallel/laravel-parallel\" alt=\"Latest Version\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://packagist.org/packages/laravel-parallel/laravel-parallel\"\u003e\u003cimg src=\"https://img.shields.io/packagist/dt/laravel-parallel/laravel-parallel\" alt=\"Total Downloads\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://packagist.org/packages/laravel-parallel/laravel-parallel\"\u003e\u003cimg src=\"https://img.shields.io/packagist/l/laravel-parallel/laravel-parallel\" alt=\"License\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://packagist.org/packages/laravel-parallel/laravel-parallel\"\u003e\u003cimg src=\"https://img.shields.io/packagist/php-v/laravel-parallel/laravel-parallel\" alt=\"PHP Version\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\nLaravel Parallel provides an intuitive, Laravel-style API for true parallel processing in your applications. Built on the battle-tested [amphp/parallel](https://github.com/amphp/parallel) library, it enables you to execute CPU-intensive tasks concurrently with automatic CPU core detection and comprehensive error handling.\n\n## Features\n\n- **Intuitive API** - Fluent, Laravel-style interface with method chaining\n- **Automatic Optimization** - Detects CPU cores for optimal parallelization\n- **True Parallelism** - Real multi-process execution, not just async/concurrent\n- **Rich Result Handling** - Comprehensive result collection with metrics and filtering\n- **Laravel Integration** - Works seamlessly with Octane, Horizon, and other Laravel features\n- **Type-Safe** - PHPStan Level 8 compliant with full type coverage\n- **Extensible Architecture** - Built on SOLID principles with clear extension points\n- **Production Ready** - Comprehensive error handling, logging, and monitoring\n- **Event-Driven** - Task lifecycle events for observability and monitoring\n\n## Installation\n\nYou can install the package via Composer:\n\n```bash\ncomposer require laravel-parallel/laravel-parallel\n```\n\n### Requirements\n\n- PHP 8.2 or higher\n- Laravel 11.0 or higher\n\n| Laravel Version | Package Version |\n|----------------|-----------------|\n| 11.x, 12.x     | ^2.0            |\n\n### Configuration (Optional)\n\nPublish the configuration file:\n\n```bash\nphp artisan vendor:publish --tag=parallel-config\n```\n\nThis will create a `config/parallel.php` file where you can customize default settings.\n\n## Quick Start\n\nExecute tasks in parallel with a simple, fluent API:\n\n```php\nuse LaravelParallel\\Facades\\Parallel;\n\n$results = Parallel::run([\n    'user_report' =\u003e fn() =\u003e generateUserReport(),\n    'sales_data' =\u003e fn() =\u003e fetchSalesData(),\n    'inventory' =\u003e fn() =\u003e syncInventory(),\n]);\n\nforeach ($results as $key =\u003e $result) {\n    if ($result-\u003eisSuccess()) {\n        echo \"Task {$key}: \" . $result-\u003egetValue();\n    }\n}\n```\n\nThat's it! Laravel Parallel automatically detects your CPU cores and distributes work efficiently.\n\n## Usage Examples\n\n### Basic Parallel Execution\n\nExecute multiple tasks concurrently:\n\n```php\nuse LaravelParallel\\Facades\\Parallel;\n\n$results = Parallel::run([\n    'task1' =\u003e fn() =\u003e expensive_operation_1(),\n    'task2' =\u003e fn() =\u003e expensive_operation_2(),\n    'task3' =\u003e fn() =\u003e expensive_operation_3(),\n]);\n\nforeach ($results as $key =\u003e $result) {\n    if ($result-\u003eisSuccess()) {\n        echo \"Task {$key}: {$result-\u003egetValue()}\\n\";\n    } else {\n        echo \"Task {$key} failed: {$result-\u003egetException()-\u003egetMessage()}\\n\";\n    }\n}\n```\n\n### Parallel Map Operation\n\nProcess collections in parallel:\n\n```php\n$users = User::all();\n\n$results = Parallel::map($users, function ($user) {\n    return [\n        'id' =\u003e $user-\u003eid,\n        'score' =\u003e calculateComplexScore($user),\n    ];\n});\n\n// Extract all values\n$scores = collect($results)-\u003emap-\u003egetValue()-\u003eall();\n```\n\n### Configuration\n\nCustomize worker count and timeout:\n\n```php\n$results = Parallel::workers(4)\n    -\u003etimeout(30.0)\n    -\u003erun([\n        'heavy1' =\u003e fn() =\u003e processLargeDataset(),\n        'heavy2' =\u003e fn() =\u003e runComplexCalculation(),\n    ]);\n```\n\n### Real-World Example: Parallel API Requests\n\nFetch multiple API endpoints simultaneously:\n\n```php\n$endpoints = [\n    'users' =\u003e 'https://api.example.com/users',\n    'posts' =\u003e 'https://api.example.com/posts',\n    'comments' =\u003e 'https://api.example.com/comments',\n];\n\n$results = Parallel::map($endpoints, function ($url) {\n    return Http::get($url)-\u003ejson();\n});\n\n$data = collect($results)\n    -\u003efilter-\u003eisSuccess()\n    -\u003emap-\u003egetValue()\n    -\u003eall();\n```\n\n## Configuration\n\nThe package works out-of-the-box with sensible defaults. You can customize behavior via the config file or environment variables:\n\n| Config Key | Env Variable | Default | Description |\n|-----------|-------------|---------|-------------|\n| `default_workers` | `PARALLEL_WORKERS` | `null` (auto-detect) | Number of worker processes |\n| `default_timeout` | `PARALLEL_TIMEOUT` | `30` | Timeout in seconds |\n| `max_workers` | `PARALLEL_MAX_WORKERS` | `128` | Maximum workers allowed |\n| `max_tasks_per_batch` | `PARALLEL_MAX_TASKS` | `10000` | Max tasks per batch |\n| `auto_chunk` | `PARALLEL_AUTO_CHUNK` | `true` | Auto-chunk large batches |\n| `chunk_size` | `PARALLEL_CHUNK_SIZE` | `1000` | Size of chunks |\n| `events.enabled` | `PARALLEL_EVENTS_ENABLED` | `true` | Enable task events |\n| `logging.enabled` | `PARALLEL_LOGGING_ENABLED` | `true` | Enable logging |\n| `logging.channel` | `PARALLEL_LOG_CHANNEL` | `stack` | Log channel |\n| `logging.level` | `PARALLEL_LOG_LEVEL` | `info` | Minimum log level |\n\nSee the [full configuration file](config/parallel.php) for all options and detailed descriptions.\n\n## Advanced Usage\n\n### Working with Results\n\nThe result collection provides powerful methods for handling parallel execution outcomes:\n\n```php\nuse LaravelParallel\\Results\\ResultCollection;\n\n$results = new ResultCollection(Parallel::run($tasks));\n\n// Filter successful results\n$successful = $results-\u003esuccessful();\n\n// Filter failed results\n$failed = $results-\u003efailed();\n\n// Extract values with default for failures\n$values = $results-\u003evaluesOr('default_value');\n\n// Get all exceptions\n$exceptions = $results-\u003eexceptions();\n\n// Check if all succeeded\nif ($results-\u003eallSuccessful()) {\n    echo \"All tasks completed successfully!\\n\";\n}\n```\n\n### Execution Metrics\n\nTrack performance with built-in metrics:\n\n```php\nuse LaravelParallel\\Results\\ExecutionMetrics;\n\n$results = new ResultCollection(Parallel::run($tasks));\n$metrics = ExecutionMetrics::fromResults($results);\n\necho \"Total tasks: {$metrics-\u003etotalTasks}\\n\";\necho \"Successful: {$metrics-\u003esuccessfulTasks}\\n\";\necho \"Failed: {$metrics-\u003efailedTasks}\\n\";\necho \"Success rate: {$metrics-\u003esuccessRate()}%\\n\";\necho \"Total time: {$metrics-\u003etotalExecutionTime}s\\n\";\necho \"Average time: {$metrics-\u003eaverageExecutionTime}s\\n\";\n```\n\n### Error Handling\n\nHandle failures gracefully:\n\n```php\n$results = Parallel::run($tasks);\n\nforeach ($results as $key =\u003e $result) {\n    $result\n        -\u003eifSuccess(fn($value) =\u003e processValue($value))\n        -\u003eifFailure(fn($exception) =\u003e handleError($exception));\n}\n```\n\n### Event Listeners\n\nListen to task lifecycle events:\n\n```php\nuse LaravelParallel\\Events\\TaskCompleted;\nuse LaravelParallel\\Events\\TaskFailed;\nuse LaravelParallel\\Events\\TaskStarted;\n\nEvent::listen(TaskCompleted::class, function ($event) {\n    Log::info(\"Task {$event-\u003etaskKey} completed in {$event-\u003eexecutionTime}s\");\n});\n\nEvent::listen(TaskFailed::class, function ($event) {\n    Log::error(\"Task {$event-\u003etaskKey} failed\", [\n        'error' =\u003e $event-\u003eexception-\u003egetMessage(),\n    ]);\n});\n```\n\n## Integrations\n\nLaravel Parallel integrates seamlessly with popular Laravel ecosystem tools to enhance monitoring, observability, and developer experience.\n\n### Laravel Horizon Integration\n\nMonitor your parallel tasks in real-time through Laravel Horizon's dashboard. The Horizon integration provides:\n\n- **Automatic metrics recording** for all parallel tasks\n- **Real-time statistics** via REST API endpoints\n- **Dashboard tagging** for easy filtering and monitoring\n- **Event-driven architecture** with zero configuration required\n\nThe integration is included with the package and activates automatically when Laravel Horizon is detected. Simply install Horizon and start using Laravel Parallel - metrics will appear in your Horizon dashboard immediately.\n\n**Quick Start:**\n\n```php\n// Execute parallel tasks as normal\n$results = Parallel::run([\n    'task1' =\u003e fn() =\u003e processData(1),\n    'task2' =\u003e fn() =\u003e processData(2),\n]);\n\n// View metrics in Horizon dashboard at /horizon\n// Filter by tag \"parallel\" to see all parallel tasks\n```\n\nFor detailed setup instructions, API documentation, and advanced configuration options, see the [Horizon Integration Guide](docs/horizon-integration.md).\n\n### Laravel Telescope Integration\n\nDebug and profile your parallel tasks with Laravel Telescope's powerful inspection tools. The Telescope integration provides:\n\n- **Task lifecycle tracking** - Monitor when tasks start, complete, or fail\n- **Execution metrics** - View execution times, results, and performance data\n- **Smart filtering** - Filter tasks by status, exception type, or execution duration\n- **Exception debugging** - Detailed stack traces and error information for failed tasks\n\nThe integration is included with the package and activates automatically when Laravel Telescope is detected. Task details appear in a dedicated \"Parallel Task\" section within your Telescope dashboard.\n\n**Quick Start:**\n\n```php\n// Execute parallel tasks as normal\n$results = Parallel::run([\n    'user_report' =\u003e fn() =\u003e generateUserReport(),\n    'sales_data' =\u003e fn() =\u003e fetchSalesData(),\n]);\n\n// View in Telescope dashboard at /telescope\n// Navigate to \"Parallel Task\" section\n// Filter by tags: parallel, parallel:completed, parallel:failed, task:user_report\n```\n\nFor detailed setup instructions, configuration options, and debugging workflows, see the [Telescope Integration Guide](docs/telescope-integration.md).\n\n### Future Integrations\n\nPlanned integrations for upcoming releases:\n\n- **Laravel Pulse** - Real-time performance monitoring and alerting\n- **Sentry** - Advanced error tracking and performance monitoring\n\n## Extending the Package\n\nLaravel Parallel is built with extensibility in mind. You can create:\n\n- **Custom Tasks**: Implement `TaskContract` for specialized task types\n- **Custom Executors**: Implement `ExecutorContract` for alternative execution strategies\n- **Custom Result Handlers**: Extend `ResultCollection` for domain-specific operations\n- **Middleware**: Intercept task execution for logging, monitoring, etc.\n\n### Creating a Custom Task\n\n```php\nuse LaravelParallel\\Tasks\\AbstractTask;\nuse Amp\\Cancellation;\nuse Amp\\Sync\\Channel;\n\nfinal class DatabaseQueryTask extends AbstractTask\n{\n    public function __construct(\n        private readonly string $query,\n        private readonly array $bindings = [],\n    ) {\n        parent::__construct();\n    }\n\n    public function run(Channel $channel, Cancellation $cancellation): mixed\n    {\n        // This runs in a worker process\n        $pdo = new PDO(/* connection details */);\n        $stmt = $pdo-\u003eprepare($this-\u003equery);\n        $stmt-\u003eexecute($this-\u003ebindings);\n\n        return $stmt-\u003efetchAll();\n    }\n}\n```\n\n### Best Practices\n\n1. **Keep Tasks Self-Contained**: Tasks should contain all data needed for execution\n2. **Handle Serialization**: Ensure all task data is serializable\n3. **Resource Management**: Recreate database connections and resources in worker processes\n4. **Error Handling**: Always handle exceptions and return meaningful error information\n\n## Architecture\n\nLaravel Parallel follows **Hexagonal Architecture** (Ports \u0026 Adapters) and **SOLID** principles for maximum maintainability and extensibility.\n\n```\n┌─────────────────────────────────────────┐\n│         Laravel Application             │\n└──────────────┬──────────────────────────┘\n               │\n        ┌──────▼──────┐\n        │  Parallel   │  (Facade)\n        │  Facade     │\n        └──────┬──────┘\n               │\n        ┌──────▼──────────┐\n        │ ParallelManager │  (Core)\n        └──────┬──────────┘\n               │\n        ┌──────▼──────────┐\n        │    Executor     │  (Core)\n        └──────┬──────────┘\n               │\n     ┌─────────┴─────────┐\n     │                   │\n┌────▼────────┐     ┌────▼────────┐\n│  Worker     │     │  Worker     │\n│  Pool       │ ... │  Pool       │\n│  Manager    │     │  Manager    │\n└─────────────┘     └─────────────┘\n```\n\n### Key Components\n\n- **Core**: Domain logic (ParallelManager, Executor, ResultCollector)\n- **Contracts**: Interfaces for extensibility (TaskContract, ExecutorContract, etc.)\n- **Tasks**: Executable work units with serialization support\n- **Workers**: Worker pool management and lifecycle\n- **Results**: Result handling with rich metrics\n\nThe package wraps the powerful [amphp/parallel](https://github.com/amphp/parallel) library with a Laravel-friendly interface.\n\n### Design Patterns\n\n- **Facade Pattern**: Static access via `Parallel` facade\n- **Factory Pattern**: Worker pool creation with dependency injection\n- **Value Object Pattern**: Immutable configuration objects\n- **Strategy Pattern**: Different task types via `TaskContract`\n- **Dependency Injection**: Constructor injection throughout\n\n## Testing\n\nRun the test suite:\n\n```bash\ncomposer test\n```\n\nRun tests with coverage:\n\n```bash\ncomposer test:coverage\n```\n\nRun static analysis:\n\n```bash\ncomposer phpstan\n```\n\nThe package maintains:\n- PHPStan Level 8 compliance\n- 77.5% test coverage (251 tests, 672 assertions)\n- Comprehensive unit and feature tests\n\n## Performance\n\n### When to Use Laravel Parallel\n\n**Ideal For:**\n- CPU-bound tasks (data processing, transformations, calculations)\n- Task sets with 10 or more tasks\n- Tasks taking 100ms or longer each\n- Immediate results needed (not background processing)\n- Laravel applications prioritizing developer experience\n\n**Better Alternatives:**\n- **Micro-tasks (\u003c100ms)**: Use sequential processing\n- **I/O-bound operations**: Use Laravel Queues or async HTTP\n- **Background jobs**: Use Laravel Queues with horizon\n- **Large data payloads (\u003e1MB)**: Consider streaming or chunking\n\n### Overhead Analysis\n\n- **Setup overhead**: ~2-5ms per execution\n- **Per-task overhead**: ~0.5-1ms (serialization + IPC)\n- **Break-even point**: 10 tasks × 100ms = 1 second total work\n\n### Example Performance\n\n```php\n// Small Workload (Not Recommended)\n// 5 tasks × 100ms = 500ms sequential\n// Parallel: ~150ms (3.2x speedup, 3% overhead)\n\n// Medium Workload (Recommended)\n// 50 tasks × 1s = 50s sequential\n// Parallel (5 cores): ~10s (4.98x speedup, 0.3% overhead)\n\n// Large Workload (Excellent)\n// 1000 tasks × 500ms = 500s sequential\n// Parallel (8 cores): ~63s (7.94x speedup, 0.8% overhead)\n```\n\n### Performance Tips\n\n**1. Optimal Worker Count**\n```php\n// For CPU-bound tasks, use CPU count\n$results = Parallel::workers(CPU_COUNT)-\u003erun($cpuTasks);\n\n// For I/O-bound tasks, use 2-3x CPU count\n$results = Parallel::workers(CPU_COUNT * 3)-\u003erun($ioTasks);\n```\n\n**2. Chunk Large Datasets**\n```php\n$items = range(1, 100000);\n$chunks = array_chunk($items, 1000);\n\n$results = Parallel::map($chunks, function ($chunk) {\n    return array_map(fn($n) =\u003e process($n), $chunk);\n});\n```\n\n**3. Balance Task Size**\n```php\n// Bad: Too many small tasks (high overhead)\n$results = Parallel::map(range(1, 100000), fn($n) =\u003e $n * 2);\n\n// Good: Reasonable task granularity\n$chunks = array_chunk(range(1, 100000), 1000);\n$results = Parallel::map($chunks, fn($chunk) =\u003e array_map(fn($n) =\u003e $n * 2, $chunk));\n```\n\n## Frequently Asked Questions\n\n### Can I use this with Laravel Octane/Swoole?\n\n**Yes!** Laravel Parallel v2.0+ is fully compatible with Laravel Octane and Swoole. The package uses non-singleton bindings to prevent state leakage between requests.\n\n### How is this different from Laravel Queues?\n\nLaravel Queues are designed for background processing with delayed execution, while Laravel Parallel is for immediate parallel execution:\n\n- **Queues**: Background processing, persistent storage, delayed execution, job retries\n- **Parallel**: Immediate execution, in-memory processing, real-time results, CPU-intensive tasks\n\nUse queues for background jobs, use parallel processing for immediate CPU-intensive operations.\n\n### How many workers should I use?\n\nThe optimal number depends on your task type:\n\n- **CPU-bound tasks**: Number of CPU cores (auto-detected by default)\n- **I/O-bound tasks**: 2-3x CPU cores\n- **Mixed workloads**: Start with CPU count and adjust based on monitoring\n\n### What happens if a task throws an exception?\n\nExceptions are caught and wrapped in a `ParallelResult` with `isFailure() === true`. Other tasks continue executing independently. You can handle failures gracefully:\n\n```php\nforeach ($results as $result) {\n    if ($result-\u003eisFailure()) {\n        $exception = $result-\u003egetException();\n        // Handle the error\n    }\n}\n```\n\n### Can I use database connections in parallel tasks?\n\nYes, but you need to be aware that each worker process has its own memory space. Database connections should be recreated within each task:\n\n```php\n$results = Parallel::map($items, function ($item) {\n    // Each worker recreates the connection\n    $user = User::find($item['user_id']);\n    return processUser($user);\n});\n```\n\n### How do I retry failed tasks?\n\nExtract failed task keys and rerun them:\n\n```php\n$results = new ResultCollection(Parallel::run($tasks));\n$failedTasks = $results-\u003efailed()-\u003ekeys()-\u003eall();\n\nif (count($failedTasks) \u003e 0) {\n    $retryTasks = collect($tasks)-\u003eonly($failedTasks)-\u003eall();\n    $retryResults = Parallel::run($retryTasks);\n}\n```\n\n### Is this package production-ready?\n\nYes! Laravel Parallel v2.0+ is built with production in mind:\n\n- PHPStan Level 8 compliance (maximum type safety)\n- Comprehensive test coverage (77.5% with 251 tests and 672 assertions)\n- Battle-tested amphp/parallel foundation\n- Used in production Laravel applications\n- Octane/Swoole compatible\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for recent changes and version history.\n\n## Contributing\n\nContributions are welcome! Please see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## Security Vulnerabilities\n\nIf you discover a security vulnerability, please email giorgospatelis@outlook.com. All security vulnerabilities will be promptly addressed.\n\n## Credits\n\n- [Giorgos Patelis](https://github.com/giorgospatelis)\n- Powered by [amphp/parallel](https://github.com/amphp/parallel)\n- All [contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiorgospatelis%2Flaravel-parallel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgiorgospatelis%2Flaravel-parallel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiorgospatelis%2Flaravel-parallel/lists"}