[PR #232] [MERGED] Refresh token with Rwlock #328

Closed
opened 2026-02-27 20:24:16 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ramsayleung/rspotify/pull/232
Author: @marioortizmanero
Created: 7/15/2021
Status: Merged
Merged: 7/16/2021
Merged by: @ramsayleung

Base: ramsay_support_refresh_tokenHead: refresh_token_rwlock


📝 Commits (7)

📊 Changes

8 files changed (+134 additions, -49 deletions)

View changed files

📝 Cargo.toml (+5 -0)
examples/ureq/threading.rs (+45 -0)
📝 examples/with_refresh_token.rs (+3 -3)
📝 src/auth_code.rs (+19 -16)
📝 src/auth_code_pkce.rs (+18 -15)
📝 src/client_creds.rs (+14 -9)
📝 src/clients/base.rs (+29 -5)
📝 src/clients/oauth.rs (+1 -1)

📄 Description

This is my attempt at #224 with a RwLock to enable concurrency.

The main drawback is that we can't derive Clone for the clients. But it allows concurrency for the client, which may be a must for blocking clients?


🔄 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/ramsayleung/rspotify/pull/232 **Author:** [@marioortizmanero](https://github.com/marioortizmanero) **Created:** 7/15/2021 **Status:** ✅ Merged **Merged:** 7/16/2021 **Merged by:** [@ramsayleung](https://github.com/ramsayleung) **Base:** `ramsay_support_refresh_token` ← **Head:** `refresh_token_rwlock` --- ### 📝 Commits (7) - [`0034a57`](https://github.com/ramsayleung/rspotify/commit/0034a57d73fa0e3bf8b815b01f5c7c249f5a19a8) Attempt at refreshing token with RwLock - [`549577e`](https://github.com/ramsayleung/rspotify/commit/549577eadbc9c0adb5bb4937f7dd9cf4d1fd50bc) Document `get_token` and `get_token_mut` - [`94a778c`](https://github.com/ramsayleung/rspotify/commit/94a778c352e2576a32cef3ae1399a107483ea564) Prettier errors for unwrap - [`6993e37`](https://github.com/ramsayleung/rspotify/commit/6993e374e9821e7baea4fe6a21b0c0c5c9d4eac2) format - [`2d5390e`](https://github.com/ramsayleung/rspotify/commit/2d5390ebff4881664448546cbf4c326200b9aaa8) get_token_mut doesn't refresh the token - [`e999802`](https://github.com/ramsayleung/rspotify/commit/e9998026a95c783d810d130823a50eecfb61fc22) Fix tests - [`cd2255d`](https://github.com/ramsayleung/rspotify/commit/cd2255d35ea449acf21c33128e43335b6b8d504b) Fix docs ### 📊 Changes **8 files changed** (+134 additions, -49 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.toml` (+5 -0) ➕ `examples/ureq/threading.rs` (+45 -0) 📝 `examples/with_refresh_token.rs` (+3 -3) 📝 `src/auth_code.rs` (+19 -16) 📝 `src/auth_code_pkce.rs` (+18 -15) 📝 `src/client_creds.rs` (+14 -9) 📝 `src/clients/base.rs` (+29 -5) 📝 `src/clients/oauth.rs` (+1 -1) </details> ### 📄 Description This is my attempt at #224 with a RwLock to enable concurrency. The main drawback is that we can't derive `Clone` for the clients. But it allows concurrency for the client, which may be a must for blocking clients? --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 20:24:16 +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/rspotify#328
No description provided.