[PR #322] [MERGED] Create a thread for network events #755

Closed
opened 2026-02-28 14:53:14 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Rigellute/spotify-tui/pull/322
Author: @Rigellute
Created: 3/5/2020
Status: Merged
Merged: 3/9/2020
Merged by: @Rigellute

Base: masterHead: async-await-tokio-3


📝 Commits (1)

  • dae20e1 Fix UI freeze on slow connections (make async)

📊 Changes

25 files changed (+1647 additions, -1078 deletions)

View changed files

📝 Cargo.lock (+80 -16)
📝 Cargo.toml (+3 -1)
📝 src/app.rs (+121 -660)
📝 src/handlers/album_list.rs (+2 -2)
📝 src/handlers/album_tracks.rs (+11 -10)
📝 src/handlers/artist.rs (+12 -7)
📝 src/handlers/artists.rs (+7 -2)
📝 src/handlers/empty.rs (+5 -5)
📝 src/handlers/home.rs (+4 -4)
📝 src/handlers/input.rs (+34 -91)
📝 src/handlers/library.rs (+5 -32)
📝 src/handlers/made_for_you.rs (+5 -1)
📝 src/handlers/mod.rs (+7 -6)
📝 src/handlers/playbar.rs (+5 -4)
📝 src/handlers/playlist.rs (+3 -10)
📝 src/handlers/recently_played.rs (+10 -6)
📝 src/handlers/search_results.rs (+11 -14)
📝 src/handlers/select_device.rs (+3 -9)
📝 src/handlers/track_table.rs (+45 -17)
📝 src/main.rs (+158 -166)

...and 5 more files

📄 Description

This is a huge PR that changes the architecture of the app considerably.

The idea is to create thread that will handle network events, while the main thread will handle the UI rendering loop.

The implication of this change is that the UI thread will disptach (or send) messages to the network thread for it then to execute the async action.

Thus, slow network calls will no longer block the UI thread meaning the app should feel more responsive on slow connections.

I have tested on very slow internet connections and can see these changes will drastically improve both #92 and #207.

Given the scale of these changes, I encourage anyone to checkout this branch and test!


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Rigellute/spotify-tui/pull/322 **Author:** [@Rigellute](https://github.com/Rigellute) **Created:** 3/5/2020 **Status:** ✅ Merged **Merged:** 3/9/2020 **Merged by:** [@Rigellute](https://github.com/Rigellute) **Base:** `master` ← **Head:** `async-await-tokio-3` --- ### 📝 Commits (1) - [`dae20e1`](https://github.com/Rigellute/spotify-tui/commit/dae20e189a6a926a34868371ae161d0b91c24e63) Fix UI freeze on slow connections (make async) ### 📊 Changes **25 files changed** (+1647 additions, -1078 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+80 -16) 📝 `Cargo.toml` (+3 -1) 📝 `src/app.rs` (+121 -660) 📝 `src/handlers/album_list.rs` (+2 -2) 📝 `src/handlers/album_tracks.rs` (+11 -10) 📝 `src/handlers/artist.rs` (+12 -7) 📝 `src/handlers/artists.rs` (+7 -2) 📝 `src/handlers/empty.rs` (+5 -5) 📝 `src/handlers/home.rs` (+4 -4) 📝 `src/handlers/input.rs` (+34 -91) 📝 `src/handlers/library.rs` (+5 -32) 📝 `src/handlers/made_for_you.rs` (+5 -1) 📝 `src/handlers/mod.rs` (+7 -6) 📝 `src/handlers/playbar.rs` (+5 -4) 📝 `src/handlers/playlist.rs` (+3 -10) 📝 `src/handlers/recently_played.rs` (+10 -6) 📝 `src/handlers/search_results.rs` (+11 -14) 📝 `src/handlers/select_device.rs` (+3 -9) 📝 `src/handlers/track_table.rs` (+45 -17) 📝 `src/main.rs` (+158 -166) _...and 5 more files_ </details> ### 📄 Description This is a huge PR that changes the architecture of the app considerably. The idea is to create thread that will handle network events, while the main thread will handle the UI rendering loop. The implication of this change is that the UI thread will disptach (or send) messages to the network thread for it then to execute the async action. Thus, slow network calls will no longer block the UI thread meaning the app should feel more responsive on slow connections. I have tested on very slow internet connections and can see these changes will drastically improve both #92 and #207. Given the scale of these changes, I encourage anyone to checkout this branch and test! --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-28 14:53:14 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify-tui#755
No description provided.