mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[PR #1359] [MERGED] Rework session keep-alive logic v2 #1359
Labels
No labels
A-Alsa
SpotifyAPI
Tokio 1.0
audio
bug
can't reproduce
compilation
dependencies
duplicate
enhancement
good first issue
help wanted
high priority
imported
imported
invalid
new api
pull-request
question
reverse engineering
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot#1359
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/librespot-org/librespot/pull/1359
Author: @wisp3rwind
Created: 10/2/2024
Status: ✅ Merged
Merged: 10/15/2024
Merged by: @roderickvd
Base:
dev← Head:pingpong-v2📝 Commits (7)
8e99a69session: Session::dispatch -> DispatchTask::dispatchdf6a09bsession: DispatchTask is a regular struct instead of tuple struct97a757dsession: rework keepalive logic to match other clients754c1b6session: use pin projection instead of Boxing in DispatchTask69f6153update Cargo.lockbeff7e9address review38f8d37increase keepalive timeouts📊 Changes
3 files changed (+265 additions, -145 deletions)
View changed files
📝
Cargo.lock(+1 -0)📝
core/Cargo.toml(+1 -0)📝
core/src/session.rs(+263 -145)📄 Description
Another approach to #1357 using the ideas from https://github.com/librespot-org/librespot/pull/1357#issuecomment-2386938448.
This looks like a big change, but much of it is just moving around code:
fn dispatchis now a part ofDispatchTasksuch that it has access to the fields ofDispatchTask(namely, the timeout and state of the keepalive state machinery).This is a little different from @roderickvd's idea: I've kept the
KeepAliveStateenum instead of just theping_receivedflag, and instead there's only a singleSleepfuture around. The deadline of the latter is modified as required.EDIT: Split into a few more commits now to make this easier to review. For testing, keep-alive events are logged at
TRACElevel.Fixes #1340
Closes #1357
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.