MCPcopy Create free account
hub / github.com/Botloader/botloader / message_reader

Function message_reader

components/simpleproto/src/lib.rs:47–61  ·  view source on GitHub ↗
(
    src: &mut (impl AsyncRead + Unpin),
    tx: mpsc::UnboundedSender<T>,
)

Source from the content-addressed store, hash-verified

45}
46
47pub async fn message_reader<T: DeserializeOwned>(
48 src: &mut (impl AsyncRead + Unpin),
49 tx: mpsc::UnboundedSender<T>,
50) -> std::io::Result<()> {
51 loop {
52 match read_message(src).await {
53 Ok(msg) => {
54 if tx.send(msg).is_err() {
55 return Ok(());
56 }
57 }
58 Err(err) => return Err(err),
59 }
60 }
61}

Callers 2

init_worker_handlesFunction · 0.85
connect_schedulerFunction · 0.85

Calls 2

read_messageFunction · 0.85
sendMethod · 0.45

Tested by

no test coverage detected