-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Stub out new properties/enum in URLSessionConfiguration #1217
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
Stub out new properties/enum in URLSessionConfiguration #1217
Conversation
@johnno1962 The two new properties in URLSessionConfiguration |
Hi, this might be useful in future but for now I can’t think of a way to implement this from the NDK. |
@parkera Can you please let us know your opinion on this? |
@salgernon could also chime in here, but -- it seems that if we have no way to reasonably implement this, we may be better off either leaving these out or marking them unavailable to warn developers that there is no implementation. |
This one falls into the category of "leafy" API that doesn't need to be implemented with |
If we think these aren't going to be implemented any time soon, we could use https://github.com/apple/swift-corelibs-foundation/blob/master/Foundation/Bundle.swift#L80 That way we allow those coding against it to know that these aren't available and will generate a compile error/warning, rather than relying on the behaviour and wondering why it doesn't work. Of course if we do think this will be implemented in the near future then |
I agree that |
@@ -209,4 +209,19 @@ open class URLSessionConfiguration : NSObject, NSCopying { | |||
*/ | |||
open var protocolClasses: [AnyClass]? | |||
|
|||
/* A Boolean value that indicates whether the session should wait for connectivity to become available, or fail immediately */ | |||
open var waitsForConnectivity: Bool = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should have a warning:
@available(*,deprecated,message:"Not available on non-Darwin platforms")
open var multipathServiceType: URLSessionConfiguration.MultipathServiceType = .none | ||
|
||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should have a warning:
@available(*,deprecated,message:"Not available on non-Darwin platforms")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can also use unavailable
to make it an error to attempt to use it.
93753d9
to
25561b4
Compare
Thanks @parkera @alblue and @ianpartridge for reviewing! I agree with all the points made above and have made changes suitably. |
@swift-ci please test and merge |
New properties per the API doc. Though they may be irrelevant in the Linux server context, they may make sense in the Android context.