fn mpsc_blocking_start_send() {
    let (mut tx, mut rx) = mpsc::channel::<i32>(0);

    block_on(futures::future::lazy(|_| {
        tx.start_send(0).unwrap();

        flag_cx(|flag, cx| {
            let mut task = StartSendFut::new(tx, 1);

            assert!(task.poll(cx).unwrap().is_pending());
            assert!(!flag.get());
            sassert_next(&mut rx, 0);
            assert!(flag.get());
            flag.set(false);
            assert!(task.poll(cx).unwrap().is_ready());
            assert!(!flag.get());
            sassert_next(&mut rx, 1);

            Ok::<(), ()>(())
        })
    })).unwrap();
}
// Test that `start_send` on an `mpsc` channel does indeed block when the
// channel is full
Test that `start_send` on an `mpsc` channel does indeed block when the
channel is full
Test that ` start_send ` on an ` mpsc ` channel does indeed block when the channel is full
fn mpsc_blocking_start_send() {
    let (mut tx, mut rx) = mpsc::channel::<i32>(0);
    block_on(futures::future::lazy(|_| {
        tx.start_send(0).unwrap();
        flag_cx(|flag, cx| {
            let mut task = StartSendFut::new(tx, 1);
            assert!(task.poll(cx).unwrap().is_pending());
            assert!(!flag.get());
            sassert_next(&mut rx, 0);
            assert!(flag.get());
            flag.set(false);
            assert!(task.poll(cx).unwrap().is_ready());
            assert!(!flag.get());
            sassert_next(&mut rx, 1);
            Ok::<(), ()>(())
        })
    })).unwrap();
}
fn mpsc_blocking_start_send ( ) { let ( mut tx , mut rx ) = mpsc :: channel :: < i32 > ( 0 ) ; block_on ( futures :: future :: lazy ( | _ | { tx . start_send ( 0 ) . unwrap ( ) ; flag_cx ( | flag , cx | { let mut task = StartSendFut :: new ( tx , 1 ) ; assert ! ( task poll ( cx ) unwrap ( ) is_pending ( ) ) ; assert ! ( flag get ( ) ) ; sassert_next ( & mut rx , 0 ) ; assert ! ( flag get ( ) ) ; flag . set ( false ) ; assert ! ( task poll ( cx ) unwrap ( ) is_ready ( ) ) ; assert ! ( flag get ( ) ) ; sassert_next ( & mut rx , 1 ) ; Ok :: < ( ) , ( ) > ( ( ) ) } ) } ) ) . unwrap ( ) ; }
Test that `start_send` on an `mpsc` channel does indeed block when the
channel is full
Test that ` start_send ` on an ` mpsc ` channel does indeed block when the channel is full