updater #1
| @ -55,14 +55,14 @@ async fn listen_for_new_vm_reqs( | |||||||
|     Ok(()) |     Ok(()) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| async fn send_confirmations( | async fn send_newvm_resp( | ||||||
|     mut client: BrainDaemonServiceClient<Channel>, |     mut client: BrainDaemonServiceClient<Channel>, | ||||||
|     rx: Receiver<NewVmConfirmation>, |     rx: Receiver<NewVmConfirmation>, | ||||||
| ) -> Result<()> { | ) -> Result<()> { | ||||||
|     debug!("starting send_confirmations stream"); |     debug!("starting send_newvm_resp stream"); | ||||||
|     let rx_stream = ReceiverStream::new(rx); |     let rx_stream = ReceiverStream::new(rx); | ||||||
|     client.send_vm_confirmations(rx_stream).await?; |     client.send_vm_confirmations(rx_stream).await?; | ||||||
|     debug!("send_confirmations is about to exit"); |     debug!("send_newvm_resp is about to exit"); | ||||||
|     Ok(()) |     Ok(()) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| @ -158,14 +158,14 @@ async fn handle_update_vm_requests( | |||||||
|     warn!("update vm request handler is ending"); |     warn!("update vm request handler is ending"); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| async fn send_confirmations_update( | async fn send_updatevm_resp( | ||||||
|     mut client: BrainDaemonServiceClient<Channel>, |     mut client: BrainDaemonServiceClient<Channel>, | ||||||
|     rx: Receiver<UpdateVmResp>, |     rx: Receiver<UpdateVmResp>, | ||||||
| ) -> Result<()> { | ) -> Result<()> { | ||||||
|     debug!("starting send_confirmations_update stream"); |     debug!("starting send_updatevm_resp stream"); | ||||||
|     let rx_stream = ReceiverStream::new(rx); |     let rx_stream = ReceiverStream::new(rx); | ||||||
|     client.send_update_vm(rx_stream).await?; |     client.send_update_vm(rx_stream).await?; | ||||||
|     debug!("send_confirmations_update is about to exit"); |     debug!("send_updatevm_resp is about to exit"); | ||||||
|     Ok(()) |     Ok(()) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| @ -226,7 +226,7 @@ async fn connect_and_run() -> Result<()> { | |||||||
| 
 | 
 | ||||||
|     let confirm_client = client.clone(); |     let confirm_client = client.clone(); | ||||||
|     let (confirm_tx, rx) = tokio::sync::mpsc::channel(6); |     let (confirm_tx, rx) = tokio::sync::mpsc::channel(6); | ||||||
|     streaming_tasks.spawn(send_confirmations(confirm_client, rx)); |     streaming_tasks.spawn(send_newvm_resp(confirm_client, rx)); | ||||||
| 
 | 
 | ||||||
|     tokio::spawn(async move { |     tokio::spawn(async move { | ||||||
|         handle_vm_requests(newvm_rx, confirm_tx).await; |         handle_vm_requests(newvm_rx, confirm_tx).await; | ||||||
| @ -238,7 +238,7 @@ async fn connect_and_run() -> Result<()> { | |||||||
| 
 | 
 | ||||||
|     let resp_client = client.clone(); |     let resp_client = client.clone(); | ||||||
|     let (resp_tx, rx) = tokio::sync::mpsc::channel(6); |     let (resp_tx, rx) = tokio::sync::mpsc::channel(6); | ||||||
|     streaming_tasks.spawn(send_confirmations_update(resp_client, rx)); |     streaming_tasks.spawn(send_updatevm_resp(resp_client, rx)); | ||||||
| 
 | 
 | ||||||
|     tokio::spawn(async move { |     tokio::spawn(async move { | ||||||
|         handle_update_vm_requests(updatevm_rx, resp_tx).await; |         handle_update_vm_requests(updatevm_rx, resp_tx).await; | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user