pub fn run(&mut self) {
        info!("Starting nym gateway!");

        let runtime = Runtime::new().unwrap();

        runtime.block_on(async {
            if let Some(duplicate_node_key) = self.check_if_same_ip_gateway_exists().await {
                if duplicate_node_key == self.identity.public_key().to_base58_string() {
                    warn!("We seem to have not unregistered after going offline - there's a node with identical identity and announce-host as us registered.")
                } else {
                    error!(
                        "Our announce-host is identical to an existing node's announce-host! (its key is {:?})",
                        duplicate_node_key
                    );
                    return;
                }
            }

            let mix_forwarding_channel = self.start_packet_forwarder();
            let clients_handler_sender = self.start_clients_handler();

            self.start_mix_socket_listener(clients_handler_sender.clone(), mix_forwarding_channel.clone());
            self.start_client_websocket_listener(mix_forwarding_channel, clients_handler_sender);

            info!("Finished nym gateway startup procedure - it should now be able to receive mix and client traffic!");

            self.wait_for_interrupt().await
        });
    }
// Rather than starting all futures with explicit `&Handle` argument, let's see how it works
// out if we make it implicit using `tokio::spawn` inside Runtime context.
// Basically more or less equivalent of using #[tokio::main] attribute.
Rather than starting all futures with explicit `&Handle` argument, let's see how it works
out if we make it implicit using `tokio::spawn` inside Runtime context.
Basically more or less equivalent of using #[tokio::main] attribute.
Rather than starting all futures with explicit ` &Handle ` argument let ' s see how it works out if we make it implicit using ` tokio :: spawn ` inside Runtime context . Basically more or less equivalent of using # [ tokio :: main ] attribute .
pub fn run(&mut self) {
        info!("Starting nym gateway!");
        let runtime = Runtime::new().unwrap();
        runtime.block_on(async {
            if let Some(duplicate_node_key) = self.check_if_same_ip_gateway_exists().await {
                if duplicate_node_key == self.identity.public_key().to_base58_string() {
                    warn!("We seem to have not unregistered after going offline - there's a node with identical identity and announce-host as us registered.")
                } else {
                    error!(
                        "Our announce-host is identical to an existing node's announce-host! (its key is {:?})",
                        duplicate_node_key
                    );
                    return;
                }
            }
            let mix_forwarding_channel = self.start_packet_forwarder();
            let clients_handler_sender = self.start_clients_handler();
            self.start_mix_socket_listener(clients_handler_sender.clone(), mix_forwarding_channel.clone());
            self.start_client_websocket_listener(mix_forwarding_channel, clients_handler_sender);
            info!("Finished nym gateway startup procedure - it should now be able to receive mix and client traffic!");
            self.wait_for_interrupt().await
        });
    }
pub fn run ( & mut self ) { info ! ( " " ) ; let runtime = Runtime :: new ( ) . unwrap ( ) ; runtime . block_on ( async { if let Some ( duplicate_node_key ) = self . check_if_same_ip_gateway_exists ( ) . await { if duplicate_node_key == self . identity . public_key ( ) . to_base58_string ( ) { warn ! ( " " ) } else { error ! ( " " duplicate_node_key ) ; return ; } } let mix_forwarding_channel = self . start_packet_forwarder ( ) ; let clients_handler_sender = self . start_clients_handler ( ) ; self . start_mix_socket_listener ( clients_handler_sender . clone ( ) , mix_forwarding_channel . clone ( ) ) ; self . start_client_websocket_listener ( mix_forwarding_channel , clients_handler_sender ) ; info ! ( " " ) ; self . wait_for_interrupt ( ) . await } ) ; }
Rather than starting all futures with explicit `&Handle` argument, let's see how it works
out if we make it implicit using `tokio::spawn` inside Runtime context.
Rather than starting all futures with explicit ` &Handle ` argument let ' s see how it works out if we make it implicit using ` tokio :: spawn ` inside Runtime context .
&mut self
&mut self