Changeset View
Changeset View
Standalone View
Standalone View
services/tunnelbroker/src/main.rs
pub mod constants; | pub mod constants; | ||||
pub mod grpc; | pub mod grpc; | ||||
pub mod websockets; | pub mod websockets; | ||||
use dashmap::DashMap; | |||||
use once_cell::sync::Lazy; | |||||
use std::io::{self, Error, ErrorKind}; | use std::io::{self, Error, ErrorKind}; | ||||
use tokio::sync::mpsc::UnboundedSender; | |||||
use tracing; | use tracing; | ||||
use tunnelbroker_messages::Messages; | |||||
pub static ACTIVE_CONNECTIONS: Lazy< | |||||
DashMap<String, UnboundedSender<Messages>>, | |||||
> = Lazy::new(DashMap::new); | |||||
#[tokio::main] | #[tokio::main] | ||||
async fn main() -> Result<(), io::Error> { | async fn main() -> Result<(), io::Error> { | ||||
let subscriber = tracing_subscriber::FmtSubscriber::new(); | let subscriber = tracing_subscriber::FmtSubscriber::new(); | ||||
tracing::subscriber::set_global_default(subscriber) | tracing::subscriber::set_global_default(subscriber) | ||||
.expect("Unable to configure tracing"); | .expect("Unable to configure tracing"); | ||||
let grpc_server = grpc::run_server(); | let grpc_server = grpc::run_server(); | ||||
Show All 11 Lines |