switon / executor
Task execution contracts and runtime adapters for Switon Framework
v1.0.0
2026-05-10 03:01 UTC
Requires
- php: >=8.3
- switon/core: ^1.0
Requires (Dev)
- switon/testing: ^1.0
Suggests
- ext-swoole: Coroutine paths; local/CI with ext runs full suite; without ext PHPUnit skips those classes (see CI matrix).
README
Task execution contracts and runtime adapters for Switon Framework.
Installation
composer require switon/executor
Requirements: PHP 8.3+
Quick Start
use Switon\Core\Attribute\Autowired; use Switon\Core\Contract\RunnerInterface; use Switon\Executor\ExecutorInterface; final class ReportRunner implements RunnerInterface { public function run(mixed $payload): array { return ['id' => $payload['id'] ?? null]; } } final class JobService { #[Autowired] protected ExecutorInterface $executor; public function runOnce(): void { $futures = $this->executor->invokeAll([[ReportRunner::class, ['id' => 1]]]); // inspect $futures[0]->isSuccessful(), result(), error() } }
Docs: https://docs.switon.dev/latest/executor
License
MIT.