// An alternative to `spawn_stream_handler` that uses the same `watch_subscriber` for every request.
An alternative to `spawn_stream_handler` that uses the same `watch_subscriber` for every request.
An alternative to ` spawn_stream_handler ` that uses the same ` watch_subscriber ` for every request .
fn spawn_annotation_controller_handler(
        holder: Arc<Mutex<AnnotationHolder>>,
    ) -> felement::AnnotationControllerProxy {
        let mut watch_subscriber = holder.lock().unwrap().new_watch_subscriber();
        let (proxy, mut stream) =
            create_proxy_and_stream::<felement::AnnotationControllerMarker>().unwrap();
        fasync::Task::spawn(async move {
            loop {
                let _ =
                    handle_one_request(holder.clone(), &mut watch_subscriber, &mut stream).await;
            }
        })
        .detach();
        proxy
    }
fn spawn_annotation_controller_handler ( holder : Arc < Mutex < AnnotationHolder > > , ) -> felement :: AnnotationControllerProxy { let mut watch_subscriber = holder . lock ( ) . unwrap ( ) . new_watch_subscriber ( ) ; let ( proxy , mut stream ) = create_proxy_and_stream :: < felement :: AnnotationControllerMarker > ( ) . unwrap ( ) ; fasync :: Task :: spawn ( async move { loop { let _ = handle_one_request ( holder . clone ( ) , & mut watch_subscriber , & mut stream ) . await ; } } ) . detach ( ) ; proxy }
An alternative to `spawn_stream_handler` that uses the same `watch_subscriber` for every request.
An alternative to ` spawn_stream_handler ` that uses the same ` watch_subscriber ` for every request .
holder
Arc<Mutex<AnnotationHolder>>