Two teams try and fill in any horizontal, vertical, or diagonal line on a bingo board by playing maps on osu! osu.bingo
osu
at microservice 32 lines 561 B view raw
1use std::sync::Arc; 2use tokio::sync::Mutex; 3 4mod postgres; 5mod redisdb; 6 7mod bingo_user; 8mod oauth_state; 9mod oauth_token; 10 11pub mod id; 12pub mod structs; 13 14pub struct DbContext { 15 pg_pool: Option<sqlx::PgPool>, 16 redis_pool: Option<r2d2::Pool<redis::Client>>, 17} 18 19impl DbContext { 20 pub fn new() -> Self { 21 DbContext { 22 pg_pool: None, 23 redis_pool: None, 24 } 25 } 26 pub async fn connect(&mut self) { 27 self.pg_connect().await; 28 self.redis_connect().await; 29 } 30} 31 32pub type Context = Arc<Mutex<DbContext>>;