Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add priority customization to request #2330

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ntnmrndn
Copy link

@ntnmrndn ntnmrndn commented Nov 8, 2023

I would like to be able to set the NSURLSessionTask's priority.
This PR adds a parameter to do that, with a default value to avoid breaking changes.
Current proposal does not allow yet to change the priority dynamically after the request is created.

I targeted the main branch because it looks like develop is outdated and I tried to avoid making breaking changes.
Fixes #2174

return requestNormal(target, callbackQueue: callbackQueue, progress: progress, priority: priority, completion: completion)
}

public func request(_ target: Target, callbackQueue: DispatchQueue?, progress: ProgressBlock?, completion: @escaping Completion) -> Cancellable {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this additional function?

does the function above with the new priority param with a default value not maintain API compatibility?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AndrewSB Old C++ habit ! I fixed it.

@ntnmrndn ntnmrndn force-pushed the priority branch 2 times, most recently from 8c98fc1 to 0e0ce18 Compare March 7, 2024 03:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NSURLSessionTask priority
2 participants