You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: cached_router.rs
    path of file: ./repos/incubator-horaedb/src/remote_engine_client/src
    
    the code of the file until where you have to start completion: // Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.  You may obtain a copy of the License at
//
//  
    
    pub async fn route(&self, table_ident: &TableIdentifier) -> Result<RouteContext> {
        // Find in cache first.
        let channel_opt = {
            let cache = self.cache.read().unwrap();
            cache.get(table_ident).cloned()
        };

        if let Some(channel) = channel_opt {
            // If found, return it.
            debug!(
                "CachedRouter found channel in cache, table_ident:{:?}",
                table_ident
            );

            Ok(channel)
        } else {
            // If not found, do real route work, and try to put it into cache(may have been
            // put by other threads).
            debug!(
                "CachedRouter didn't find channel in cache, table_ident:{:?}",
                table_ident
            );
            let channel = self.do_route(table_ident).await?;

            {
                let mut cache = self.cache.write().unwrap();
                // Double check here, if still not found, we put it.
                let channel_opt = cache.get(table_ident);
                if channel_opt.is_none() {
                    debug!(
                        "CachedRouter put the new channel to cache, table_ident:{:?}",
                        table_ident
                    );
                    let _ = cache.insert(table_ident.clone(), channel.clone());
                }
            }

            Ok(channel)
        }
    }