MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / run

Method run

src/sql-server-util/src/lib.rs:614–634  ·  view source on GitHub ↗
(mut self)

Source from the content-addressed store, hash-verified

612
613impl Connection {
614 async fn run(mut self) {
615 while let Some(Request { tx, kind }) = self.rx.recv().await {
616 tracing::trace!(?kind, "processing SQL Server query");
617 let result = Connection::handle_request(&mut self.client, kind).await;
618 let (response, maybe_extra_work) = match result {
619 Ok((response, work)) => (Ok(response), work),
620 Err(err) => (Err(err), None),
621 };
622
623 // We don't care if our listener for this query has gone away.
624 let _ = tx.send(response);
625
626 // After we handle a request there might still be something in-flight
627 // that we need to continue driving, e.g. when the response is a
628 // Stream of Rows.
629 if let Some(extra_work) = maybe_extra_work {
630 extra_work.await;
631 }
632 }
633 tracing::debug!("channel closed, SQL Server InnerClient shutting down");
634 }
635
636 async fn handle_request<'c>(
637 client: &'c mut tiberius::Client<Compat<TcpStream>>,

Callers 4

into_futureMethod · 0.45
test_parserFunction · 0.45
test_datadrivenFunction · 0.45
datadrivenFunction · 0.45

Calls 2

recvMethod · 0.45
sendMethod · 0.45

Tested by 3

test_parserFunction · 0.36
test_datadrivenFunction · 0.36
datadrivenFunction · 0.36