Skip to content

Commit ce84f2b

Browse files
committed
switch to node builder
1 parent 63938a4 commit ce84f2b

File tree

7 files changed

+315
-289
lines changed

7 files changed

+315
-289
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pulsebeam/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ tokio-metrics = { version = "0.4.6", features = ["metrics-rs-integration"] }
4040
once_cell = "1.21.3"
4141
ahash = "0.8.12"
4242
tokio-stream = { version = "0.1.17", features = ["sync"] }
43-
futures-concurrency = "7.6.3"
4443
clap = { version = "4.5.53", features = ["derive"] }
4544

4645
[target.'cfg(not(target_env = "msvc"))'.dependencies]

pulsebeam/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ pub mod participant;
99
pub mod proto;
1010
pub mod room;
1111
pub mod rtp;
12-
pub mod shard;
1312
pub mod track;
1413

1514
#[cfg(test)]

pulsebeam/src/main.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,20 @@ fn main() {
5757
pub async fn run(shutdown: CancellationToken, workers: usize, rtc_port: u16) {
5858
let external_ip = select_host_address();
5959
let external_addr: SocketAddr = format!("{}:{}", external_ip, rtc_port).parse().unwrap();
60-
6160
let local_addr: SocketAddr = format!("0.0.0.0:{}", rtc_port).parse().unwrap();
62-
let http_addr: SocketAddr = "0.0.0.0:3000".parse().unwrap();
63-
let internal_http_addr: SocketAddr = "0.0.0.0:6060".parse().unwrap();
64-
tracing::info!(
65-
"server listening at {}:3000 (signaling), {}:{} (webrtc), and 0.0.0.0:6060 (metrics/pprof)",
66-
external_ip,
67-
external_ip,
68-
rtc_port
69-
);
70-
71-
// Run the main logic and signal handler concurrently
61+
62+
let node_handle = node::NodeBuilder::new()
63+
.workers(workers)
64+
.local_addr(local_addr)
65+
.external_addr(external_addr)
66+
.with_http_api("0.0.0.0:3000".parse().unwrap())
67+
.with_internal_metrics("0.0.0.0:6060".parse().unwrap())
68+
.run(shutdown.clone());
69+
70+
tracing::info!("server started...");
71+
7272
tokio::select! {
73-
Err(err) = node::run(shutdown.clone(), workers, external_addr, local_addr, http_addr, internal_http_addr) => {
73+
Err(err) = node_handle => {
7474
tracing::warn!("node exited with error: {err}");
7575
}
7676
_ = system::wait_for_signal() => {

0 commit comments

Comments
 (0)