MCPcopy Create free account
hub / github.com/Firstyear/opensuse-proxy-cache / poll_flush

Method poll_flush

opensuse-proxy-cache/src/main.rs:790–812  ·  view source on GitHub ↗
(mut self: Pin<&mut Self>, cx: &mut Context<'_>)

Source from the content-addressed store, hash-verified

788 }
789
790 fn poll_flush(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<std::io::Result<()>> {
791 let mut this = self.as_mut().project();
792
793 let res_a = this.sink_a.poll_flush(cx);
794 let res_b = match *this.sink_b_state {
795 SinkState::Err => {
796 // Skip this sink now.
797 Poll::Ready(Ok(()))
798 }
799 _ => this.sink_b.poll_flush(cx),
800 };
801
802 match (res_a, res_b) {
803 (Poll::Ready(Ok(())), Poll::Ready(Ok(()))) => Poll::Ready(Ok(())),
804 (Poll::Ready(Err(err)), _) => Poll::Ready(Err(err)),
805 (res_a, Poll::Ready(Err(_err))) => {
806 eprintln!("sink b -> err");
807 *this.sink_b_state = SinkState::Err;
808 res_a
809 }
810 (Poll::Pending, _) | (_, Poll::Pending) => Poll::Pending,
811 }
812 }
813
814 fn poll_shutdown(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<std::io::Result<()>> {
815 let mut this = self.as_mut().project();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected