pub fn new(runtime: Arc<Mutex<Runtime>>) -> Self {
        let pool = runtime
            .try_lock()
            .expect("Unable to get runtime lock to start database pool")
            .block_on(async {
                PgPool::new(
                    &std::env::var("DATABASE_URL")
                        .expect("DATABASE_URL enviroment variable not set"),
                )
                .await
                .expect("unable to connect to db")
            });
        FancyPool {
            postgres_pool: pool,
        }
    }
/// Returns a new instance of FancyPool, using the tokio runtime
Returns a new instance of FancyPool, using the tokio runtime
Returns a new instance of FancyPool using the tokio runtime
pub fn new(runtime: Arc<Mutex<Runtime>>) -> Self {
        let pool = runtime
            .try_lock()
            .expect("Unable to get runtime lock to start database pool")
            .block_on(async {
                PgPool::new(
                    &std::env::var("DATABASE_URL")
                        .expect("DATABASE_URL enviroment variable not set"),
                )
                .await
                .expect("unable to connect to db")
            });
        FancyPool {
            postgres_pool: pool,
        }
    }
pub fn new ( runtime : Arc < Mutex < Runtime > > ) -> Self { let pool = runtime . try_lock ( ) . expect ( " " ) . block_on ( async { PgPool :: new ( & std :: env :: var ( " " ) . expect ( " " ) , ) . await . expect ( " " ) } ) ; FancyPool { postgres_pool : pool , } }
Returns a new instance of FancyPool, using the tokio runtime
Returns a new instance of FancyPool using the tokio runtime
runtime
Arc<Mutex<Runtime>>
runtime
Arc<Mutex<Runtime>>