move cmd off of grpc
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
mod connection;
|
||||
|
||||
use crate::command::service::CommandManagementService;
|
||||
use crate::http::backend::connection::BackendConnection;
|
||||
use crate::telemetry::management_service::TelemetryManagementService;
|
||||
use actix_web::{rt, web, HttpRequest, HttpResponse};
|
||||
@@ -14,6 +15,7 @@ async fn backend_connect(
|
||||
stream: web::Payload,
|
||||
cancel_token: web::Data<CancellationToken>,
|
||||
telemetry_management_service: web::Data<Arc<TelemetryManagementService>>,
|
||||
command_management_service: web::Data<Arc<CommandManagementService>>,
|
||||
) -> Result<HttpResponse, actix_web::Error> {
|
||||
trace!("backend_connect");
|
||||
let (res, session, stream) = actix_ws::handle(&req, stream)?;
|
||||
@@ -25,9 +27,10 @@ async fn backend_connect(
|
||||
|
||||
let cancel_token = cancel_token.get_ref().clone();
|
||||
let tlm_management = telemetry_management_service.get_ref().clone();
|
||||
let cmd_management = command_management_service.get_ref().clone();
|
||||
|
||||
rt::spawn(async move {
|
||||
let mut connection = BackendConnection::new(session, tlm_management);
|
||||
let mut connection = BackendConnection::new(session, tlm_management, cmd_management);
|
||||
while !connection.should_close {
|
||||
let result = select! {
|
||||
_ = cancel_token.cancelled() => {
|
||||
|
||||
Reference in New Issue
Block a user