public function post(CommandInterface $command) { $command_type = $command->getType(); if (!$this->subscriptions->hasKey($command_type)) { return false; } $subscription = $this->subscriptions->getItem($command_type); $transport = $subscription->getCommandTransport(); $enriched_command = $this->command_enricher->enrich($command); return $transport->send($enriched_command); }
public function send(CommandInterface $command) { $this->job_service->dispatch(new ExecuteCommandJob($this->command_bus, ['command' => $command]), new Settings(['routing_key' => $this->queue_name ?: $command->getType(), 'exchange' => $this->exchange])); }