public function sendNotification(Notification $notification)
    {
        try {
            $connection = $this->getConnection($notification->getType());
            $connection->setNotification($notification);

            $this->logger->info(
                sprintf(
                    "Dispatching notification id: %s",
                    $notification->getIdentifier()
                )
            );

            $this
                ->responseHandler
                ->addIdentifiedResponse(
                    $notification->getIdentifier(),
                    $connection->sendRequest()
                );

            return true;

        } catch (ClientException $e) {
            $this->logger->error(
                sprintf("Client connection error: %s", $e->getMessage())
            );

        } catch (RuntimeException $e) {
            $this->logger->error(
                sprintf("Runtime error: %s", $e->getMessage())
            );

        } catch (\Exception $e) {
            $this->logger->error(
                sprintf("Error occurs: %s", $e->getMessage())
            );
        }

        return false;
    }
public function sendNotification(Notification $notification)
    {
        try {
            $connection = $this->getConnection($notification->getType());
            $connection->setNotification($notification);

            $this->logger->info(
                sprintf(
                    "Dispatching notification id: %s",
                    $notification->getIdentifier()
                )
            );

            $this
                ->responseHandler
                ->addIdentifiedResponse(
                    $notification->getIdentifier(),
                    $connection->sendRequest()
                );

            return true;

        } catch (ClientException $e) {
            $this->logger->error(
                sprintf("Client connection error: %s", $e->getMessage())
            );

        } catch (RuntimeException $e) {
            $this->logger->error(
                sprintf("Runtime error: %s", $e->getMessage())
            );

        } catch (\Exception $e) {
            $this->logger->error(
                sprintf("Error occurs: %s", $e->getMessage())
            );
        }

        return false;
    }
public function sendNotification ( Notification $ notification ) { try { $ connection = $ this -> getConnection ( $ notification -> getType ( ) ) ; $ connection -> setNotification ( $ notification ) ; $ this -> logger -> info ( sprintf ( "Dispatching notification id: %s" , $ notification -> getIdentifier ( ) ) ) ; $ this -> responseHandler -> addIdentifiedResponse ( $ notification -> getIdentifier ( ) , $ connection -> sendRequest ( ) ) ; return true ; } catch ( ClientException $ e ) { $ this -> logger -> error ( sprintf ( "Client connection error: %s" , $ e -> getMessage ( ) ) ) ; } catch ( RuntimeException $ e ) { $ this -> logger -> error ( sprintf ( "Runtime error: %s" , $ e -> getMessage ( ) ) ) ; } catch ( \ Exception $ e ) { $ this -> logger -> error ( sprintf ( "Error occurs: %s" , $ e -> getMessage ( ) ) ) ; } return false ; }
Tries to connect and send a notification

@param Notification $notification
@return bool
Tries to connect and send a notification