// Helper function to call duplex streaming handler.
Helper function to call duplex streaming handler.
Helper function to call duplex streaming handler .
pub fn execute_duplex_streaming<P, Q, F>(
    ctx: RpcContext,
    ser: SerializeFn<Q>,
    de: DeserializeFn<P>,
    f: &mut F,
) where
    F: FnMut(RpcContext, RequestStream<P>, DuplexSink<Q>),
{
    let mut call = ctx.call();
    let close_f = accept_call!(call);
    let call = Arc::new(SpinLock::new(ShareCall::new(call, close_f)));
    let req_s = RequestStream::new(call.clone(), de);
    let sink = DuplexSink::new(call, ser);
    f(ctx, req_s, sink)
}
pub fn execute_duplex_streaming < P , Q , F > ( ctx : RpcContext , ser : SerializeFn < Q > , de : DeserializeFn < P > , f : & mut F , ) where F : FnMut ( RpcContext , RequestStream < P > , DuplexSink < Q > ) , { let mut call = ctx . call ( ) ; let close_f = accept_call ! ( call ) ; let call = Arc :: new ( SpinLock :: new ( ShareCall :: new ( call , close_f ) ) ) ; let req_s = RequestStream :: new ( call . clone ( ) , de ) ; let sink = DuplexSink :: new ( call , ser ) ; f ( ctx , req_s , sink ) }
Helper function to call duplex streaming handler.
Helper function to call duplex streaming handler .
ctx
RpcContext
ser
SerializeFn<Q>
de
DeserializeFn<P>
f
&mut F