|
1 | 1 | use crate::{ |
2 | 2 | Coordinator, handler::CliRequestHandler, log_subscriber::LogSubscriber, send_log_message, |
3 | 3 | }; |
4 | | -use communication_layer_request_reply::{ |
5 | | - AsyncTransport, encoding::JsonEncoding, transport::FramedTransport, |
6 | | -}; |
| 4 | +use communication_layer_request_reply::{AsyncTransport, transport::FramedTransport}; |
7 | 5 | use dora_message::cli_to_coordinator::{ |
8 | | - CliToCoordinator, CliToCoordinatorRequest, CliToCoordinatorResponse, |
| 6 | + CliToCoordinator, CliToCoordinatorEncoding, CliToCoordinatorRequest, CliToCoordinatorResponse, |
9 | 7 | }; |
10 | 8 | use eyre::{Context, eyre}; |
11 | 9 | use futures::{ |
@@ -84,7 +82,9 @@ pub(crate) async fn listen( |
84 | 82 | async fn handle_requests(state: Arc<ListenState>, connection: TcpStream) { |
85 | 83 | let peer_addr = connection.peer_addr().ok(); |
86 | 84 | let mut transport = FramedTransport::new(connection) |
87 | | - .with_encoding::<_, CliToCoordinatorResponse, CliToCoordinatorRequest>(JsonEncoding); |
| 85 | + .with_encoding::<_, CliToCoordinatorResponse, CliToCoordinatorRequest>( |
| 86 | + CliToCoordinatorEncoding, |
| 87 | + ); |
88 | 88 | loop { |
89 | 89 | let next_request = transport.receive().map(Either::Left); |
90 | 90 | let coordinator_stopped = state.cancel_token.cancelled().map(Either::Right); |
@@ -147,7 +147,7 @@ async fn handle_requests(state: Arc<ListenState>, connection: TcpStream) { |
147 | 147 |
|
148 | 148 | log_subscribers.push(LogSubscriber::new( |
149 | 149 | level, |
150 | | - transport.into_inner().into_inner(), |
| 150 | + transport.into_inner(), |
151 | 151 | )); |
152 | 152 | let buffered = std::mem::take(buffered_log_messages); |
153 | 153 | for message in buffered { |
|
0 commit comments