MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / ensure_launch_agent_service

Function ensure_launch_agent_service

packages/server/src/main.rs:1303–1325  ·  view source on GitHub ↗
(options: ServiceLaunchOptions)

Source from the content-addressed store, hash-verified

1301}
1302
1303fn ensure_launch_agent_service(options: ServiceLaunchOptions) -> anyhow::Result<ServiceMetadata> {
1304 if let Some(metadata) = read_service_metadata().ok().flatten() {
1305 if service_is_healthy(&metadata) {
1306 let _ = terminate_service_metadata(&metadata);
1307 }
1308 }
1309 let result = service::pair(ServiceOptions {
1310 port: options.port,
1311 bind: options.bind,
1312 advertise_host: options.advertise_host.clone(),
1313 client_root: options.client_root.clone(),
1314 video_codec: options.video_codec,
1315 android_gpu: options.android_gpu,
1316 low_latency: options.low_latency,
1317 stream_quality_profile: options.stream_quality_profile.clone(),
1318 local_stream_fps: options.local_stream_fps,
1319 access_token: None,
1320 pairing_code: None,
1321 })?;
1322 let metadata = metadata_from_launch_agent(result)?;
1323 wait_for_service(&metadata, Duration::from_secs(15))?;
1324 Ok(metadata)
1325}
1326
1327fn start_project_service(options: ServiceLaunchOptions) -> anyhow::Result<ServiceMetadata> {
1328 let project_root = project_root()?;

Callers 1

run_default_serviceFunction · 0.85

Calls 7

read_service_metadataFunction · 0.85
service_is_healthyFunction · 0.85
pairFunction · 0.85
wait_for_serviceFunction · 0.85
cloneMethod · 0.65

Tested by

no test coverage detected