mirror of
https://github.com/ramsayleung/rspotify.git
synced 2026-04-26 07:55:55 +03:00
[PR #391] [MERGED] Make Paginator Send to enable scheduling onto a multithreaded runtime #430
Labels
No labels
Stale
bug
discussion
enhancement
good first issue
good first issue
help wanted
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/rspotify#430
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/ramsayleung/rspotify/pull/391
Author: @darkwisebear
Created: 2/25/2023
Status: ✅ Merged
Merged: 3/1/2023
Merged by: @ramsayleung
Base:
master← Head:paginator-add-send-sync📝 Commits (2)
f8e4b52Add test to verify thread safety bounds on Paginator41d5273Mark paginator as thread safe📊 Changes
1 file changed (+49 additions, -10 deletions)
View changed files
📝
src/clients/pagination/stream.rs(+49 -10)📄 Description
Description
Paginator is in fact a boxed trait object. However, it doesn't implement Send which is a requirement when scheduling onto a async multithreaded scheduler.
Motivation and Context
Using a Paginator which is not Send will also make the enclosing Future not Send. Therefore , when using tokio with the default scheduler, this will only work in the main thread.
Dependencies
None.
Type of change
Please delete options that are not relevant.
How has this been tested?
The first commit adds a test that sets
Sync, which multithreaded async schedulers usually have. This test will not compile without modifying the code, just like if you try to schedule a future using a Paginator without a Send bound.Please also list any relevant details for your test configuration
Is this change properly documented?
Since this change only relaxes requirements for the user of the Paginator, no documentation change was made.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.