@@ -36,10 +36,6 @@ macro_rules! enter_sync {
3636pub fn init ( cx : & mut neon:: prelude:: ModuleContext ) -> neon:: prelude:: NeonResult < ( ) > {
3737 cx. export_function ( "newRuntime" , runtime_new) ?;
3838 cx. export_function ( "runtimeShutdown" , runtime_shutdown) ?;
39- // cx.export_function(
40- // "runtimeGetWorkerHeartbeatIntervalMillis",
41- // runtime_get_worker_heartbeat_interval_millis,
42- // )?;
4339
4440 Ok ( ( ) )
4541}
@@ -55,7 +51,6 @@ pub struct Runtime {
5551 // For some unknown reason, the otel metrics exporter will go crazy on shutdown in some
5652 // scenarios if we don't hold on to the `CoreOtelMeter` till the `Runtime` finally gets dropped.
5753 _otel_metrics_exporter : Option < Arc < dyn CoreMeter + ' static > > ,
58- // worker_heartbeat_interval_millis: Option<u64>,
5954}
6055
6156/// Initialize Core global telemetry and create the tokio runtime required to run Core.
@@ -64,13 +59,11 @@ pub struct Runtime {
6459pub fn runtime_new (
6560 bridge_options : config:: RuntimeOptions ,
6661) -> BridgeResult < OpaqueOutboundHandle < Runtime > > {
67- let ( telemetry_options, metrics_options, logging_options, worker_heartbeat_interval_millis) =
68- bridge_options. try_into ( ) ?;
62+ let ( telemetry_options, metrics_options, logging_options) = bridge_options. try_into ( ) ?;
6963
7064 // Create core runtime which starts tokio multi-thread runtime
7165 let runtime_options = RuntimeOptionsBuilder :: default ( )
7266 . telemetry_options ( telemetry_options)
73- . heartbeat_interval ( worker_heartbeat_interval_millis. map ( Duration :: from_millis) )
7467 . build ( )
7568 . context ( "Failed to build runtime options" ) ?;
7669 let mut core_runtime = CoreRuntime :: new ( runtime_options, TokioRuntimeBuilder :: default ( ) )
@@ -132,7 +125,6 @@ pub fn runtime_new(
132125 log_exporter_task,
133126 metrics_exporter_task : prom_metrics_exporter_task. map ( Arc :: new) ,
134127 _otel_metrics_exporter : otel_metrics_exporter,
135- // worker_heartbeat_interval_millis: runtime_options.worker_heartbeat_interval.map(|d| d.as_millis() as u64),
136128 } ) )
137129}
138130
@@ -146,21 +138,6 @@ pub fn runtime_shutdown(runtime: OpaqueInboundHandle<Runtime>) -> BridgeResult<(
146138 Ok ( ( ) )
147139}
148140
149- // #[js_function]
150- // pub fn runtime_get_worker_heartbeat_interval_millis(
151- // runtime: OpaqueInboundHandle<Runtime>,
152- // ) -> BridgeResult<Option<u32>> {
153- // runtime
154- // .borrow()?
155- // .worker_heartbeat_interval_millis
156- // .map(u32::try_from)
157- // .transpose()
158- // .map_err(|_| BridgeError::TypeError {
159- // field: None,
160- // message: "workerHeartbeatIntervalMillis is too large to represent in JavaScript".into(),
161- // })
162- // }
163-
164141/// Drop will handle the cleanup
165142impl MutableFinalize for Runtime { }
166143
@@ -288,7 +265,6 @@ mod config {
288265 log_exporter : LogExporterOptions ,
289266 telemetry : TelemetryOptions ,
290267 metrics_exporter : Option < MetricsExporterOptions > ,
291- worker_heartbeat_interval_millis : Option < u64 > ,
292268 }
293269
294270 #[ derive( Debug , Clone , TryFromJs ) ]
@@ -345,7 +321,6 @@ mod config {
345321 CoreTelemetryOptions ,
346322 Option < super :: BridgeMetricsExporter > ,
347323 super :: BridgeLogExporter ,
348- Option < u64 > ,
349324 ) > for RuntimeOptions
350325 {
351326 type Error = BridgeError ;
@@ -355,16 +330,8 @@ mod config {
355330 CoreTelemetryOptions ,
356331 Option < super :: BridgeMetricsExporter > ,
357332 super :: BridgeLogExporter ,
358- Option < u64 > ,
359333 ) > {
360- let Self {
361- log_exporter,
362- telemetry,
363- metrics_exporter,
364- worker_heartbeat_interval_millis,
365- } = self ;
366-
367- let ( telemetry_logger, log_exporter) = match log_exporter {
334+ let ( telemetry_logger, log_exporter) = match self . log_exporter {
368335 LogExporterOptions :: Console { filter } => (
369336 CoreTelemetryLogger :: Console { filter } ,
370337 BridgeLogExporter :: Console ,
@@ -384,21 +351,17 @@ mod config {
384351 let mut telemetry_options = TelemetryOptionsBuilder :: default ( ) ;
385352 let telemetry_options = telemetry_options
386353 . logging ( telemetry_logger)
387- . metric_prefix ( telemetry. metric_prefix )
388- . attach_service_name ( telemetry. attach_service_name )
354+ . metric_prefix ( self . telemetry . metric_prefix )
355+ . attach_service_name ( self . telemetry . attach_service_name )
389356 . build ( )
390357 . context ( "Failed to build telemetry options" ) ?;
391358
392- let metrics_exporter = metrics_exporter
359+ let metrics_exporter = self
360+ . metrics_exporter
393361 . map ( std:: convert:: TryInto :: try_into)
394362 . transpose ( ) ?;
395363
396- Ok ( (
397- telemetry_options,
398- metrics_exporter,
399- log_exporter,
400- worker_heartbeat_interval_millis,
401- ) )
364+ Ok ( ( telemetry_options, metrics_exporter, log_exporter) )
402365 }
403366 }
404367
0 commit comments