fn start_setting_keyspace_for_connection(
        &mut self,
        connection: Connection,
        error_receiver: ErrorReceiver,
        requested_shard: Option<Shard>,
    ) {
        // TODO: There should be a timeout for this

        let keyspace_name = self.current_keyspace.as_ref().cloned().unwrap();
        self.ready_connections.push(
            async move {
                let result = connection.use_keyspace(&keyspace_name).await;
                if let Err(err) = result {
                    warn!(
                        "[{}] Failed to set keyspace for new connection: {}",
                        connection.get_connect_address().ip(),
                        err,
                    );
                }
                OpenedConnectionEvent {
                    result: Ok((connection, error_receiver)),
                    requested_shard,
                    keyspace_name: Some(keyspace_name),
                }
            }
            .boxed(),
        );
    }
// Requires the keyspace to be set
// Requires that the event is for a successful connection
Requires the keyspace to be set
Requires that the event is for a successful connection
Requires the keyspace to be set Requires that the event is for a successful connection
fn start_setting_keyspace_for_connection(
        &mut self,
        connection: Connection,
        error_receiver: ErrorReceiver,
        requested_shard: Option<Shard>,
    ) {
        // TODO: There should be a timeout for this
        let keyspace_name = self.current_keyspace.as_ref().cloned().unwrap();
        self.ready_connections.push(
            async move {
                let result = connection.use_keyspace(&keyspace_name).await;
                if let Err(err) = result {
                    warn!(
                        "[{}] Failed to set keyspace for new connection: {}",
                        connection.get_connect_address().ip(),
                        err,
                    );
                }
                OpenedConnectionEvent {
                    result: Ok((connection, error_receiver)),
                    requested_shard,
                    keyspace_name: Some(keyspace_name),
                }
            }
            .boxed(),
        );
    }
fn start_setting_keyspace_for_connection ( & mut self , connection : Connection , error_receiver : ErrorReceiver , requested_shard : Option < Shard > , ) { // TODO: There should be a timeout for this let keyspace_name = self . current_keyspace . as_ref ( ) . cloned ( ) . unwrap ( ) ; self . ready_connections . push ( async move { let result = connection . use_keyspace ( & keyspace_name ) . await ; if let Err ( err ) = result { warn ! ( " " connection get_connect_address ( ) ip ( ) err ) ; } OpenedConnectionEvent { result : Ok ( ( connection , error_receiver ) ) , requested_shard , keyspace_name : Some ( keyspace_name ) , } } . boxed ( ) , ) ; }
Requires the keyspace to be set
Requires that the event is for a successful connection
Requires the keyspace to be set Requires that the event is for a successful connection
&mut self
connection
Connection
error_receiver
ErrorReceiver
requested_shard
Option<Shard>
&mut self
connection
Connection
error_receiver
ErrorReceiver
requested_shard
Option<Shard>