Skip to content

Feature - Moving SessionDelegate to Store Requests #1391

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

Merged
merged 1 commit into from
Aug 11, 2016

Conversation

cnoon
Copy link
Member

@cnoon cnoon commented Aug 10, 2016

This PR modifies the SessionDelegate to store Requests internally instead of only the task delegates of the Request in preparation for more advanced features such as retry logic.

There are no functional changes to the behavior in this PR.

taskDelegateLock.lock() ; defer { taskDelegateLock.unlock() }
taskDelegate = newValue
}
}
Copy link
Member Author

Choose a reason for hiding this comment

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

This may be overkill to wrap the change here in a lock, but I figure it's better safe than sorry. The only time this can ever change is when a data task is converted to a download task. Previously we were changing the subdelegate and not actually updating the request. That then created a mismatch between what the Request delegate reported and what was actually called.

Copy link
Member Author

Choose a reason for hiding this comment

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

If we decide this is unnecessary, then it's really simple. We just need to remove the taskDelegate and the taskDelegateLock and revert this change while maintaining the internal(set) var delegate change.

@jshier
Copy link
Contributor

jshier commented Aug 11, 2016

👍 Feel free to merge.

@cnoon
Copy link
Member Author

cnoon commented Aug 11, 2016

Awesome...thanks @jshier!

@cnoon cnoon merged commit 4e16b45 into swift3 Aug 11, 2016
@cnoon cnoon deleted the feature/moving-session-delegate-to-store-requests branch August 11, 2016 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants