Dispatches a message to the bus.

@param object|Envelope $message The message or the message pre-wrapped in an envelope

@final
764393
protected function dispatchMessage($message): Envelope
    {
        if (!$this->container->has('messenger.default_bus')) {
            $message = class_exists(Envelope::class) ? 'You need to define the "messenger.default_bus" configuration option.' : 'Try running "composer require symfony/messenger".';
            throw new \LogicException('The message bus is not enabled in your application. '.$message);
        }

        return $this->container->get('messenger.default_bus')->dispatch($message);
    }
970462
public function queue(Message $message)
	{
		// Bump the message ID
		$this->lastMessageId++;

		// Put the message in an envelope
		$envelope = new MessageEnvelope($this->lastMessageId, $message);

		// Save the message so we can update it later on
		$this->storeMessageEnvelope($envelope);

		// Queue and return the envelope
		$this->logger->debug('Queuing Apns\Message #' . $this->lastMessageId . ' to device "' . $message->getDeviceToken() . '" on Apns\Gateway with certificate "' . $this->getCertificate()->getDescription() . '"');
		$this->sendQueue->enqueue($envelope);

		return $envelope;
	}
377342
protected function processMessage($message) {
    // Check if the message was forward
    isset($message['forward_from']) ? $index = 'forward_from' : $index = 'from';

    $response = $this->prepareResponse($message[$index]);
    $this->sendMessage($response);
  }
92726
protected function sendSwiftMessage( $message )
	{
		Hooks::trigger( 'mailer.sending', compact( $message ) );

		try
		{
			$this->swift->send( $message, $this->failedRecipients );
		}
		finally
		{
			$this->swift->getTransport()->stop();
		}
	}
1175663
protected function dispatch(IncomingMessage $message)
    {
        foreach ($this->eventListeners as $data) {
            $listener = $data[0];
            $predicate = $data[1];
            if (is_callable($predicate) && !call_user_func($predicate, $message)) {
                continue;
            }
            if ($listener instanceof \Closure) {
                $listener($message);
            } elseif (is_array($listener)) {
                $listener[0]->{$listener[1]}($message);
            } else {
                $listener->handle($message);
            }
        }
    }
1068148
public function onMessage(Mf4phpMessage $message) : void
    {
        Preconditions::checkArgument($message instanceof ObjectMessage, "Message must be an instance of ObjectMessage");
        $object = $message->getObject();
        if ($object instanceof MessageWrapper) {
            $object = $object->getMessage();
        }
        parent::dispatch($object, self::emptyCallback());
    }
1363344
protected function _send($message)
    {
        $options = [
            'headers' => ['Authorization' => 'Bearer ' . $this->getConfig('api_key')]
        ];
        $response = $this->http->post('/api/mail.send.json', $message, $options);
        if ($response->getStatusCode() !== 200) {
            throw new SendgridEmailException(sprintf(
                'SendGrid error %s %s: %s',
                $response->getStatusCode(),
                $response->getReasonPhrase(),
                implode('; ', $response->json['errors'])
            ));
        }

        return $response->json;
    }
1370157
public function dispatch(MessageInterface $message)
    {
        $builder = $this->notificationBuilder;

        $notifications = $builder->buildNotifications($message);

        /** @var Notification $notification */
        foreach ($notifications as $notification) {
            $this->sendNotification($notification);
        }

        return $this;
    }
1000343
public function sendMessage($level, $message)
    {
        $mail = new Message($this->from);

        $mail->setTo($this->to);
        $mail->setText(ucfirst($level).': '.$message, $this->type);

        /** @var ITransport $transport */
        $transport = (new TransportInjector)->build();
        $transport->send($mail);
    }
320590
public function log($message)
    {
        $messages = (array) $message;
        foreach ($messages as $message) {
            $this->getLogger()->info($this->prependHandle($message));
        }
    }
433381
protected function handleMessage($message)
    {
        if (!is_null($response = $this->call('message.*', array($message)))) {
            return $response;
        }

        return $this->call("message.{$message['MsgType']}", array($message));
    }
279675
public function sendMessage( $message )
	{
		if( !$this->receiver )
			throw new RuntimeException( 'No Receiver set.' );
		$this->sendMessageTo( $message, $this->receiver->get() );
	}
194334
protected function sendMessage(Message $message) {
		if(!$this->isIgnored($message)) {
			parent::sendMessage($message);
			$this->sentMessages[] = $message;
		}
	}
22511
public function send(Message $message) : void
    {
        $destination = $this->getRedirectURL($message);
        Utils::getContainer()->redirect($destination);
    }
918236
public static function emerg($message, array $extras = [])
    {
        if (self::$logger) {
            self::$logger->emerg($message, $extras);
        }
    }
1069376
public function logMessage(Message $message) {
        foreach($this->logger as $logger) {
            $logger->logMessage($message);
        }
    }
277945
public function sendMessage(Message $message): void
    {
        // Ensure the message will always be sent to the default channel if asked for.
        if ($this->options['sticky_channel']) {
            $message->setChannel($this->options['channel']);
        }

        $payload = $this->preparePayload($message);

        $encoded = \json_encode($payload, JSON_UNESCAPED_UNICODE);

        if (false === $encoded) {
            throw new \RuntimeException(\sprintf('JSON encoding error %s: %s', \json_last_error(), \json_last_error_msg()));
        }

        $this->httpClient->post('', [], $encoded);
    }