Rename notify_server to connect_to_server

This commit is contained in:
Kunal Mohan 2021-03-26 13:13:00 +05:30
parent e30ec5745e
commit 813547483f
4 changed files with 6 additions and 5 deletions

View file

@ -10,7 +10,7 @@ pub mod utils;
pub mod wasm_vm;
use std::io::Write;
use std::path::{Path, PathBuf};
use std::path::Path;
use std::sync::mpsc;
use std::thread;
use std::{collections::HashMap, fs};
@ -183,7 +183,7 @@ pub fn start(
let mut send_app_instructions =
SenderWithContext::new(err_ctx, SenderType::SyncSender(send_app_instructions));
os_input.notify_server();
os_input.connect_to_server();
#[cfg(not(test))]
std::panic::set_hook({

View file

@ -342,7 +342,7 @@ pub trait ClientOsApi: Send + Sync {
// This should be called from the client-side router thread only.
fn client_recv(&self) -> (ClientInstruction, ErrorContext);
/// Setup the client IpcChannel and notify server of new client
fn notify_server(&mut self);
fn connect_to_server(&mut self);
}
impl ClientOsApi for ClientOsInputOutput {
@ -378,7 +378,7 @@ impl ClientOsApi for ClientOsInputOutput {
fn update_senders(&mut self, new_ctx: ErrorContext) {
self.server_sender.update(new_ctx);
}
fn notify_server(&mut self) {
fn connect_to_server(&mut self) {
let (client_buffer_path, client_buffer) =
SharedRingBuffer::create_temp(IPC_BUFFER_SIZE).unwrap();
self.client_receiver = Some(Arc::new(Mutex::new(IpcReceiver::new(

View file

@ -75,6 +75,7 @@ pub fn main() {
} else if let Some(file_to_open) = opts.open_file {
get_client_os_input().send_to_server(ServerInstruction::OpenFile(file_to_open));
} else {
// Mind the order: server_os_input should be created before client_os_input
let server_os_input = get_server_os_input();
let os_input = get_client_os_input();
atomic_create_dir(ZELLIJ_TMP_DIR).unwrap();

View file

@ -189,7 +189,7 @@ impl ClientOsApi for FakeInputOutput {
self.server_sender.update(new_ctx);
self.client_sender.update(new_ctx);
}
fn notify_server(&mut self) {
fn connect_to_server(&mut self) {
ClientOsApi::send_to_server(self, ServerInstruction::NewClient("zellij".into()));
}
fn client_recv(&self) -> (ClientInstruction, ErrorContext) {