pub async fn leave_realm(core: &mut Core<'_>, res: Sender<Result<(), WampError>>) -> Status {
    core.valid_session = false;

    if let Err(e) = core
        .send(&Msg::Goodbye {
            reason: "wamp.close.close_realm".to_string(),
            details: WampDict::new(),
        })
        .await
    {
        let _ = res.send(Err(e));
        return Status::Shutdown;
    }

    let _ = res.send(Ok(()));

    Status::Ok
}
/// Handler for any leave realm request. This function will send a GOODBYE and wait for a GOODBYE response
Handler for any leave realm request. This function will send a GOODBYE and wait for a GOODBYE response
Handler for any leave realm request . This function will send a GOODBYE and wait for a GOODBYE response
pub async fn leave_realm(core: &mut Core<'_>, res: Sender<Result<(), WampError>>) -> Status {
    core.valid_session = false;
    if let Err(e) = core
        .send(&Msg::Goodbye {
            reason: "wamp.close.close_realm".to_string(),
            details: WampDict::new(),
        })
        .await
    {
        let _ = res.send(Err(e));
        return Status::Shutdown;
    }
    let _ = res.send(Ok(()));
    Status::Ok
}
pub async fn leave_realm ( core : & mut Core < ' _ > , res : Sender < Result < ( ) , WampError > > ) -> Status { core . valid_session = false ; if let Err ( e ) = core . send ( & Msg :: Goodbye { reason : " " . to_string ( ) , details : WampDict :: new ( ) , } ) . await { let _ = res . send ( Err ( e ) ) ; return Status :: Shutdown ; } let _ = res . send ( Ok ( ( ) ) ) ; Status :: Ok }
Handler for any leave realm request.
Handler for any leave realm request .
core
&mut Core<'_>
res
Sender<Result<(), WampError>>