mirror of
https://github.com/openai/codex.git
synced 2026-04-29 08:56:38 +00:00
Wire notification sender into exec-server RPC foundation
Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
@@ -2,15 +2,18 @@ use codex_app_server_protocol::JSONRPCErrorError;
|
||||
|
||||
use crate::protocol::InitializeResponse;
|
||||
use crate::protocol::PROTOCOL_VERSION;
|
||||
use crate::rpc::RpcNotificationSender;
|
||||
|
||||
pub(crate) struct ExecServerHandler {
|
||||
_notifications: RpcNotificationSender,
|
||||
initialize_requested: bool,
|
||||
initialized: bool,
|
||||
}
|
||||
|
||||
impl ExecServerHandler {
|
||||
pub(crate) fn new() -> Self {
|
||||
pub(crate) fn new(notifications: RpcNotificationSender) -> Self {
|
||||
Self {
|
||||
_notifications: notifications,
|
||||
initialize_requested: false,
|
||||
initialized: false,
|
||||
}
|
||||
|
||||
@@ -20,8 +20,8 @@ pub(crate) async fn run_connection(connection: JsonRpcConnection) {
|
||||
let (json_outgoing_tx, mut incoming_rx, _connection_tasks) = connection.into_parts();
|
||||
let (outgoing_tx, mut outgoing_rx) =
|
||||
mpsc::channel::<RpcServerOutboundMessage>(CHANNEL_CAPACITY);
|
||||
let handler = Arc::new(Mutex::new(ExecServerHandler::new()));
|
||||
let _notifications = RpcNotificationSender::new(outgoing_tx.clone());
|
||||
let notifications = RpcNotificationSender::new(outgoing_tx.clone());
|
||||
let handler = Arc::new(Mutex::new(ExecServerHandler::new(notifications)));
|
||||
|
||||
let outbound_task = tokio::spawn(async move {
|
||||
while let Some(message) = outgoing_rx.recv().await {
|
||||
|
||||
Reference in New Issue
Block a user