pub fn initialize<T, U, S>(stream: S, opts: DistantServerOptions) -> Self
    where
        T: DataStream + Send + 'static,
        U: Codec + Send + 'static,
        S: Stream<Item = Transport<T, U>> + Send + Unpin + 'static,
    {
        // Build our state for the server
        let state: Arc<Mutex<State>> = Arc::new(Mutex::new(State::default()));
        let (shutdown, tracker) = ShutdownTask::maybe_initialize(opts.shutdown_after);

        // Spawn our connection task
        let conn_task = tokio::spawn(async move {
            connection_loop(stream, state, tracker, shutdown, opts.max_msg_capacity).await
        });

        Self { conn_task }
    }
/// Initialize a distant server using the provided listener
Initialize a distant server using the provided listener
Initialize a distant server using the provided listener
pub fn initialize<T, U, S>(stream: S, opts: DistantServerOptions) -> Self
    where
        T: DataStream + Send + 'static,
        U: Codec + Send + 'static,
        S: Stream<Item = Transport<T, U>> + Send + Unpin + 'static,
    {
        // Build our state for the server
        let state: Arc<Mutex<State>> = Arc::new(Mutex::new(State::default()));
        let (shutdown, tracker) = ShutdownTask::maybe_initialize(opts.shutdown_after);
        // Spawn our connection task
        let conn_task = tokio::spawn(async move {
            connection_loop(stream, state, tracker, shutdown, opts.max_msg_capacity).await
        });
        Self { conn_task }
    }
pub fn initialize < T , U , S > ( stream : S , opts : DistantServerOptions ) -> Self where T : DataStream + Send + ' static , U : Codec + Send + ' static , S : Stream < Item = Transport < T , U > > + Send + Unpin + ' static , { // Build our state for the server let state : Arc < Mutex < State > > = Arc :: new ( Mutex :: new ( State :: default ( ) ) ) ; let ( shutdown , tracker ) = ShutdownTask :: maybe_initialize ( opts . shutdown_after ) ; // Spawn our connection task let conn_task = tokio :: spawn ( async move { connection_loop ( stream , state , tracker , shutdown , opts . max_msg_capacity ) . await } ) ; Self { conn_task } }
Initialize a distant server using the provided listener
Initialize a distant server using the provided listener
stream
S
opts
DistantServerOptions