pub fn send_sync_notification(
        &self,
        protocol_name: Cow<'static, str>,
        message: impl Into<Vec<u8>>,
    ) {
        let mut lock = self.inner.sync_channel.lock();
        let result = lock.try_send(NotificationsSinkMessage::Notification {
            protocol_name,
            message: message.into(),
        });

        if result.is_err() {
            // Cloning the `mpsc::Sender` guarantees the allocation of an extra spot in the
            // buffer, and therefore that `try_send` will succeed.
            let _result2 = lock.clone().try_send(NotificationsSinkMessage::ForceClose);
            debug_assert!(_result2
                .map(|()| true)
                .unwrap_or_else(|err| err.is_disconnected()));
        }
    }
/// Sends a notification to the peer.
///
/// If too many messages are already buffered, the notification is silently discarded and the
/// connection to the peer will be closed shortly after.
///
/// The protocol name is expected to be checked ahead of calling this method. It is a logic
/// error to send a notification using an unknown protocol.
///
/// This method will be removed in a future version.
Sends a notification to the peer.
If too many messages are already buffered, the notification is silently discarded and the
connection to the peer will be closed shortly after.

The protocol name is expected to be checked ahead of calling this method. It is a logic
error to send a notification using an unknown protocol.

This method will be removed in a future version.
Sends a notification to the peer . If too many messages are already buffered the notification is silently discarded and the connection to the peer will be closed shortly after . The protocol name is expected to be checked ahead of calling this method . It is a logic error to send a notification using an unknown protocol . This method will be removed in a future version .
pub fn send_sync_notification(
        &self,
        protocol_name: Cow<'static, str>,
        message: impl Into<Vec<u8>>,
    ) {
        let mut lock = self.inner.sync_channel.lock();
        let result = lock.try_send(NotificationsSinkMessage::Notification {
            protocol_name,
            message: message.into(),
        });
        if result.is_err() {
            // Cloning the `mpsc::Sender` guarantees the allocation of an extra spot in the
            // buffer, and therefore that `try_send` will succeed.
            let _result2 = lock.clone().try_send(NotificationsSinkMessage::ForceClose);
            debug_assert!(_result2
                .map(|()| true)
                .unwrap_or_else(|err| err.is_disconnected()));
        }
    }
pub fn send_sync_notification ( & self , protocol_name : Cow < ' static , str > , message : impl Into < Vec < u8 > > , ) { let mut lock = self . inner . sync_channel . lock ( ) ; let result = lock . try_send ( NotificationsSinkMessage :: Notification { protocol_name , message : message . into ( ) , } ) ; if result . is_err ( ) { // Cloning the `mpsc::Sender` guarantees the allocation of an extra spot in the // buffer, and therefore that `try_send` will succeed. let _result2 = lock . clone ( ) . try_send ( NotificationsSinkMessage :: ForceClose ) ; debug_assert ! ( _result2 map ( ( ) true ) unwrap_or_else ( err err is_disconnected ( ) ) ) ; } }
Sends a notification to the peer.
Sends a notification to the peer .
&self
protocol_name
Cow<'static, str>
message
impl Into<Vec<u8>>
&self
protocol_name
Cow<'static, str>
message
impl Into<Vec<u8>>