| | |
| | | if (!defined('ABSPATH')) { |
| | | exit; |
| | | } |
| | | |
| | | use InvalidArgumentException; |
| | | use JVBase\managers\queue\mergers\DefaultMerger; |
| | | |
| | | final class TypeRegistry |
| | |
| | | |
| | | public function getExecutor(string $type): ?Executor |
| | | { |
| | | return $this->configs[$type]?->executor; |
| | | return array_key_exists($type, $this->configs) ? $this->configs[$type]->executor : Queue::getInstance()->executor; |
| | | } |
| | | |
| | | public function getMergeable(string $type): ?Mergeable |
| | |
| | | if ($config->executor && $config->chunkKey) { |
| | | // Verify executor can handle chunked operations |
| | | if (!method_exists($config->executor, 'execute')) { |
| | | throw new \InvalidArgumentException( |
| | | throw new InvalidArgumentException( |
| | | "Executor for '{$type}' must implement execute() method" |
| | | ); |
| | | } |