diff options
| author | har7an <99636919+har7an@users.noreply.github.com> | 2026-02-19 11:59:14 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-19 12:59:14 +0100 |
| commit | 3a9cf0a6d6b98dee0246e6fa5a539e1f6d546084 (patch) | |
| tree | 5021050e1d0984de3ca27295bd6ed6b83058d9c1 /zellij-client/src/remote_attach/mod.rs | |
| parent | fix: tab-bar wrapping for extremely small widths (#4728) (diff) | |
| download | sl0ppij-3a9cf0a6d6b98dee0246e6fa5a539e1f6d546084.tar.gz sl0ppij-3a9cf0a6d6b98dee0246e6fa5a539e1f6d546084.tar.xz sl0ppij-3a9cf0a6d6b98dee0246e6fa5a539e1f6d546084.zip | |
Purge `async_std` from the codebase (#4672)
* build(utils): Replace `async_std` with `tokio`
removing an entire async runtime from the dependency tree. `tokio` has
previously been required by `wasmtime` in any case, and the version of
async_std we used was ancient (1.3) and relied on unstable features.
* build(server): Remove `async_std` from the codebase
and replace it with `tokio` instead, which is already used by
`zellij-utils` and `wasmtime`.
* build(server): Remove dead dependency.
* fix: Don't keep an async runtime in the `zellij-utils` subcrate
but prefer to reuse an existing runtime from a caller instead. If no
such runtime exists, create an ephemeral runtime on the current thread
to run async tasks instead. Ideally, the functions needing the async
task would be async themselves, but these are called by the `Layout`
code based on a `ClientMsg`, and the code handling this currently lives
in `zellij-utils` and is sync itself. So, for the time being, there is
no way around this runtime requirement without a huge refactoring.
* refactor(server): Unclutter async tasks
in a few cases where either blocking code was called in an (unnecessary)
async task or an entire thread was spawned to block on the result of an
async task.
* docs(CHANGELOG): Mention PR 4672
* fix(server): Don't terminate when killing a panes children fails
but log the error and continue instead.
* feat: Add config option for number of async tasks to spawn
so users on machines with few resources can configure a task limit
without requiring recompilation.
Diffstat (limited to 'zellij-client/src/remote_attach/mod.rs')
| -rw-r--r-- | zellij-client/src/remote_attach/mod.rs | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/zellij-client/src/remote_attach/mod.rs b/zellij-client/src/remote_attach/mod.rs index 02664e82..d6d7cf32 100644 --- a/zellij-client/src/remote_attach/mod.rs +++ b/zellij-client/src/remote_attach/mod.rs @@ -10,7 +10,7 @@ pub use websockets::WebSocketConnections; use crate::os_input_output::ClientOsApi; use crate::RemoteClientError; -use tokio::runtime::Runtime; +use tokio::runtime::Handle; use zellij_utils::remote_session_tokens; // In tests, only attempt once (no retries) to avoid interactive prompts @@ -32,7 +32,7 @@ const MAX_AUTH_ATTEMPTS: u32 = 3; /// /// Returns WebSocketConnections on success pub fn attach_to_remote_session( - runtime: &Runtime, + runtime: Handle, _os_input: Box<dyn ClientOsApi>, remote_session_url: &str, token: Option<String>, @@ -53,9 +53,11 @@ pub fn attach_to_remote_session( } if token.is_none() { - if let Some(connections) = - try_to_connect_with_saved_session_token(runtime, remote_session_url, &server_url)? - { + if let Some(connections) = try_to_connect_with_saved_session_token( + runtime.clone(), + remote_session_url, + &server_url, + )? { return Ok(connections); } } @@ -67,7 +69,7 @@ pub fn attach_to_remote_session( /// Try to connect using a saved session token /// Returns Ok(Some(connections)) on success, Ok(None) if should retry with auth fn try_to_connect_with_saved_session_token( - runtime: &Runtime, + runtime: Handle, remote_session_url: &str, server_url: &str, ) -> Result<Option<WebSocketConnections>, RemoteClientError> { @@ -94,7 +96,7 @@ fn try_to_connect_with_saved_session_token( } fn authenticate_with_retry( - runtime: &Runtime, + runtime: Handle, remote_session_url: &str, initial_token: Option<String>, remember: bool, |
