pub async fn run_font_resolver_service(
    font_package_manager: Arc<FontPackageManager>,
    cache: PackageCache,
    package_fetcher: Arc<PackageFetcher>,
    stream: FontResolverRequestStream,
    cobalt_sender: CobaltSender,
) -> Result<(), Error> {
    stream
        .map_err(anyhow::Error::new)
        .try_for_each_concurrent(None, |event| async {
            let FontResolverRequest::Resolve {
                package_url,
                update_policy: _,
                directory_request,
                responder,
            } = event;

            let status = resolve_font(
                &font_package_manager,
                &cache,
                &package_fetcher,
                package_url,
                directory_request,
                cobalt_sender.clone(),
            )
            .await;
            responder.send(Status::from(status).into_raw())?;

            Ok(())
        })
        .await
}
/// Run a service that only resolves registered font packages.
Run a service that only resolves registered font packages.
Run a service that only resolves registered font packages .
pub async fn run_font_resolver_service(
    font_package_manager: Arc<FontPackageManager>,
    cache: PackageCache,
    package_fetcher: Arc<PackageFetcher>,
    stream: FontResolverRequestStream,
    cobalt_sender: CobaltSender,
) -> Result<(), Error> {
    stream
        .map_err(anyhow::Error::new)
        .try_for_each_concurrent(None, |event| async {
            let FontResolverRequest::Resolve {
                package_url,
                update_policy: _,
                directory_request,
                responder,
            } = event;
            let status = resolve_font(
                &font_package_manager,
                &cache,
                &package_fetcher,
                package_url,
                directory_request,
                cobalt_sender.clone(),
            )
            .await;
            responder.send(Status::from(status).into_raw())?;
            Ok(())
        })
        .await
}
pub async fn run_font_resolver_service ( font_package_manager : Arc < FontPackageManager > , cache : PackageCache , package_fetcher : Arc < PackageFetcher > , stream : FontResolverRequestStream , cobalt_sender : CobaltSender , ) -> Result < ( ) , Error > { stream . map_err ( anyhow :: Error :: new ) . try_for_each_concurrent ( None , | event | async { let FontResolverRequest :: Resolve { package_url , update_policy : _ , directory_request , responder , } = event ; let status = resolve_font ( & font_package_manager , & cache , & package_fetcher , package_url , directory_request , cobalt_sender . clone ( ) , ) . await ; responder . send ( Status :: from ( status ) . into_raw ( ) ) ? ; Ok ( ( ) ) } ) . await }
Run a service that only resolves registered font packages.
Run a service that only resolves registered font packages .
font_package_manager
Arc<FontPackageManager>
cache
PackageCache
package_fetcher
Arc<PackageFetcher>
stream
FontResolverRequestStream
cobalt_sender
CobaltSender
font_package_manager
Arc<FontPackageManager>
cache
PackageCache
package_fetcher
Arc<PackageFetcher>
stream
FontResolverRequestStream
cobalt_sender
CobaltSender