pub fn close(&mut self) {
        if let Some(inner) = &mut self.inner {
            inner.set_closed();

            // Wake up any threads waiting as they'll see that we've closed the
            // channel and will continue on their merry way.
            while let Some(task) = unsafe { inner.parked_queue.pop_spin() } {
                task.lock().unwrap().notify();
            }
        }
    }
Closes the receiving half of a channel, without dropping it.

This prevents any further messages from being sent on the channel while
still enabling the receiver to drain messages that are buffered.
futures-channel/src/mpsc/mod.rs