async fn handle_log_sink_requests(
        self,
        mut stream: LogSinkRequestStream,
        source: SourceIdentity,
    ) -> Result<(), Error> {
        while let Some(LogSinkRequest::Connect { socket, control_handle }) =
            stream.try_next().await?
        {
            let source = SourceIdentity {
                component_name: source.component_name.clone(),
                component_url: source.component_url.clone(),
                instance_id: source.instance_id.clone(),
                realm_path: source.realm_path.clone(),
            };
            let log_stream = match LogMessageSocket::new(socket, source)
                .context("creating log stream from socket")
            {
                Ok(s) => s,
                Err(e) => {
                    control_handle.shutdown();
                    return Err(e);
                }
            };

            fasync::spawn(self.clone().drain_messages(log_stream));
        }
        Ok(())
    }
/// Handle incoming LogSink requests, currently only to receive sockets that will contain logs.
Handle incoming LogSink requests, currently only to receive sockets that will contain logs.
Handle incoming LogSink requests currently only to receive sockets that will contain logs .
async fn handle_log_sink_requests(
        self,
        mut stream: LogSinkRequestStream,
        source: SourceIdentity,
    ) -> Result<(), Error> {
        while let Some(LogSinkRequest::Connect { socket, control_handle }) =
            stream.try_next().await?
        {
            let source = SourceIdentity {
                component_name: source.component_name.clone(),
                component_url: source.component_url.clone(),
                instance_id: source.instance_id.clone(),
                realm_path: source.realm_path.clone(),
            };
            let log_stream = match LogMessageSocket::new(socket, source)
                .context("creating log stream from socket")
            {
                Ok(s) => s,
                Err(e) => {
                    control_handle.shutdown();
                    return Err(e);
                }
            };
            fasync::spawn(self.clone().drain_messages(log_stream));
        }
        Ok(())
    }
async fn handle_log_sink_requests ( self , mut stream : LogSinkRequestStream , source : SourceIdentity , ) -> Result < ( ) , Error > { while let Some ( LogSinkRequest :: Connect { socket , control_handle } ) = stream . try_next ( ) . await ? { let source = SourceIdentity { component_name : source . component_name . clone ( ) , component_url : source . component_url . clone ( ) , instance_id : source . instance_id . clone ( ) , realm_path : source . realm_path . clone ( ) , } ; let log_stream = match LogMessageSocket :: new ( socket , source ) . context ( " " ) { Ok ( s ) => s , Err ( e ) => { control_handle . shutdown ( ) ; return Err ( e ) ; } } ; fasync :: spawn ( self . clone ( ) . drain_messages ( log_stream ) ) ; } Ok ( ( ) ) }
Handle incoming LogSink requests, currently only to receive sockets that will contain logs.
Handle incoming LogSink requests currently only to receive sockets that will contain logs .
self
stream
LogSinkRequestStream
source
SourceIdentity
self
stream
LogSinkRequestStream
source
SourceIdentity