mirror of
https://github.com/Rigellute/spotify-tui.git
synced 2026-04-26 08:05:57 +03:00
[PR #322] [MERGED] Create a thread for network events #755
Labels
No labels
bug
enhancement
good first issue
help wanted
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotify-tui#755
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 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:
master← Head:async-await-tokio-3📝 Commits (1)
dae20e1Fix 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.